package visiopuce.ui.view;

import java.awt.Desktop;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.RoundingMode;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.nebula.widgets.formattedtext.DateFormatter;
import org.eclipse.nebula.widgets.formattedtext.FormattedText;
import org.eclipse.nebula.widgets.formattedtext.MaskFormatter;
import org.eclipse.nebula.widgets.formattedtext.NumberFormatter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wb.swt.ResourceManager;
import org.eclipse.wb.swt.SWTResourceManager;

import visiopuce.ApplicationContexte;
import visiopuce.objets.Analyse;
import visiopuce.objets.Biomedecine;
import visiopuce.objets.Champ;
import visiopuce.objets.Personne;
import visiopuce.objets.Prelevement;
import visiopuce.objets.Secteur;
import visiopuce.objets.TypePrelevement;
import visiopuce.objets.Utilisateur;
import visiopuce.service.AnalyseServiceImpl;
import visiopuce.service.DroitServiceImpl;
import visiopuce.service.PersonneServiceImpl;
import visiopuce.service.PrelevementServiceImpl;
import visiopuce.service.ReferentielServiceImpl;
import visiopuce.service.UtilisateurServiceImpl;
import visiopuce.service.document.DemandeFishDoc;
import visiopuce.service.document.EnvoiADN;
import visiopuce.ui.EnvoyerCotationDialog;
import visiopuce.ui.NbDialog;
import visiopuce.ui.NumPrelevDialog;
import visiopuce.ui.listener.GenererCultureListener;
import visiopuce.ui.listener.SelectionSecteurListener;
import visiopuce.ui.providers.PrelevementLabelProvider;
import visiopuce.ui.providers.TypeIndicationLabelProvider;
import visiopuce.ui.providers.TypePrelevementLabelProvider;
import visiopuce.ui.providers.UtilisateurLabelProvider;

public class PrelevementTabItem implements IDossierTabItem<Prelevement> {

	private Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
	private Button btnRadioBanques;
	private Button btnRadioCellules;
	private Button btnCheckDpi;
	private Button btnRadioPostnatal;
	private Button btnRadioPrenatal;
	private Button btnRadioPucesPost;
	private Button btnRadioPucesPre;
	private Button btnCheckRecherche;
	private Button btnRadioFoeto;
	private FormattedText tNSejour;

	private ComboViewer comboPrescripteur2;
	private ComboViewer comboPrescripteur3;
	private ComboViewer comboPrescripteur;
	private Text tNomPrenomAutrePresc;
	private Combo tUFPrescr;

	private Text tInfoIndication;
	private Button btnRadioPucesFoeto;
	private Button btnCheckGarderCultureLA;

	private Button btnCheckGarderCultureVC;
	private ArrayList<Combo> comboAspectCulotLA = new ArrayList<Combo>();
	private Combo comboAspectFibro;
	private ArrayList<Combo> comboAspectLA = new ArrayList<Combo>();
	private Button[] comboAspectMacroVC = new Button[ApplicationContexte.qualiteMacroVC.length];
	private Button[] comboAspectMicroVC = new Button[ApplicationContexte.qualiteMicroVC.length];
	private ArrayList<Combo> comboAspectSang = new ArrayList<Combo>();
	private ComboViewer comboDerive;
	private ArrayList<Combo> comboTube = new ArrayList<Combo>();
	private ComboViewer comboTypeEchantillon;
	private ComboViewer comboTypeIndication;
	private ArrayList<Combo> comboVolCulotLA = new ArrayList<Combo>();
	private Combo comboVolFibro;
	private ArrayList<Combo> comboVolLA = new ArrayList<Combo>();
	private ArrayList<Combo> comboVolSang = new ArrayList<Combo>();
	private Combo comboVolVC;
	private ArrayList<Text> tCommentaireEnvoi = new ArrayList<Text>();
	private Composite composite_1;
	private FormattedText dateDG;
	private FormattedText dateNaissanceMere;
	private FormattedText datePrelev;
	private FormattedText dateReception;
	private Group gpAD;
	private Group gpF;
	private Group gpLA;
	private Group gpEnvoiADN;
	private ArrayList<Group> ssgpLA = new ArrayList<Group>();
	private ArrayList<Group> ssgpS = new ArrayList<Group>();
	private Group gpS;
	private Group gpVC;
	private Group groupEchantillon;

	private Group groupPrenatal;
	private boolean isModifiable;
	private ArrayList<Label> lblASpeAspectCulotLA = new ArrayList<Label>();
	private ArrayList<Label> lblASpeAspectLA = new ArrayList<Label>();
	private Label lblASpeAspectMacroVC;
	private Label lblASpeAspectMicroVC;
	private ArrayList<Label> lblAspectCulotLA = new ArrayList<Label>();
	private ArrayList<Label> lblAspectLA = new ArrayList<Label>();

	private ArrayList<Label> lblASpeTube = new ArrayList<Label>();
	private ArrayList<Label> lblASpeVolLA = new ArrayList<Label>();

	private ArrayList<Label> lblVolCulotLA = new ArrayList<Label>();
	private ArrayList<Label> lblVolLA = new ArrayList<Label>();
	private List listAnalyse;
	private Prelevement prelevement;

	public TabItem prelevementTabItem;
	private ArrayList<Label> raisonEnvoi = new ArrayList<Label>();

	private Button btnCheckExtraction;
	private FormattedText t260_230;
	private FormattedText t260_280;
	private FormattedText tAE;
	private FormattedText tConcentrationADN;
	private FormattedText tVolADN;
	private Text tRangementADN;
	private FormattedText dateExtraction;

	private Button btnCheckPurification;
	private FormattedText t260_230purif;
	private FormattedText t260_280purif;
	private FormattedText tAEpurif;
	private FormattedText tConcentrationADNpurif;
	private FormattedText tVolADNpurif;
	private Text tRangementADNpurif;
	private FormattedText datePurification;

	private FormattedText tAgeMat;
	private FormattedText tAlphaSecond;
	private ArrayList<Text> tASpecifierTube = new ArrayList<Text>();
	private FormattedText tBetaPrem;
	private FormattedText tBetaSecond;
	private FormattedText tCombine;

	private FormattedText tLCCPrem;
	private FormattedText tMqSerique;
	private Text tNumeroPrelevement;
	private FormattedText tNuquePrem;
	private FormattedText tPAPPAPrem;

	private FormattedText tSequentielIntegre;
	private Text tSigneAppel;
	private FormattedText tTerme;

	private ArrayList<Button> btnCheckEnvoye = new ArrayList<Button>();
	private ArrayList<Text> tASpecifierAspectCulotLA = new ArrayList<Text>();
	private ArrayList<Text> tASpecifierAspectLA = new ArrayList<Text>();
	private Text tASpecifierAspectMacroVC;
	private Text tASpecifierAspectMicroVC;
	private ArrayList<Text> tASpecifierVolLA = new ArrayList<Text>();

	private ModifyListener modifyListener;
	private SelectionAdapter selectionListener;

	private int nbLA = 0;
	private int nbEnvoiADN = 0;
	private int nbSang = 0;
	private Button btnAjouterUneAnalyse;
	private Button btnAjouterUnDocument;
	private Group gpListeAnalyse;
	private Group gpListeDocument;

	private ToolItem itemAddAnalyse;
	private SelectionAdapter itemAddAnalyseSelectionListener;
	private ISelectionChangedListener comboTypeEchantillonSelectionChangedListener;

	private SelectionSecteurListener selectionSecteurListener;
	private Button btnRadioSexefF;
	private Button btnRadioSexefM;
	private Button btnRadioSexefNA;
	private Button btnRadioSexefI;
	private ArrayList<Text> tRangementSang = new ArrayList<Text>();

	private FormattedText dateMiseEnCultureF;
	private Button bGenererFeuilleCultureF;
	private ArrayList<FormattedText> dateMiseEnCultureS = new ArrayList<FormattedText>();
	private Button bGenererFeuilleCultureS;
	private FormattedText dateMiseEnCultureVC;
	private Button bGenererFeuilleCultureVC;
	private FormattedText dateMiseEnCultureLA;
	private Button bGenererFeuilleCultureLA;
	private Button bModifierNumero;
	private Button bModifierNnbChamp;
	private ArrayList<Button> bSupS = new ArrayList<Button>();
	private ArrayList<Button> bSupLA = new ArrayList<Button>();
	private SelectionAdapter addTubeSelectionListener;
	private ISelectionChangedListener selectionChangedComboPresc;
	private ToolItem itemEnvoyerCotation;
	private SelectionAdapter itemEnvoyerCotationSelectionListener;
	private Label lblCotationEnvoyee;
	private ScrolledComposite sc1;
	private Label lblConforme;
	private Button bAjouterNonConformite;

	private Button btnEnvoyerADN;
	private ArrayList<FormattedText> tVolEnvoye = new ArrayList<FormattedText>();

	private ArrayList<FormattedText> dateEnvoi = new ArrayList<FormattedText>();
	private ArrayList<FormattedText> dateDemande = new ArrayList<FormattedText>();
	private ArrayList<Button> btnFormulaireEnvoi = new ArrayList<Button>();
	private ArrayList<ComboViewer> comboDemandeur = new ArrayList<ComboViewer>();
	private ComboViewer comboPonctionneur;
	private Label lblNom;
	private Label lblPrenom;
	private Group groupCulture;

	public PrelevementTabItem(TabFolder parent, int style, boolean modifiable) {
		prelevementTabItem = new TabItem(parent, style);

		modifyListener = new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				if (((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()) != null) {
					((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).setDirty(true);
				}
			}
		};
		selectionListener = new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).setDirty(true);
			}
		};
		itemAddAnalyseSelectionListener = new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				if (!((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).isModifiable()) {
					((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getItemModifier().notifyListeners(SWT.Selection, null);
				}
				if (((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).isModifiable()) {
					Analyse newAnalyse = new Analyse();
					newAnalyse.setIdAnalyse(0);
					newAnalyse.setPrelevement(getPrelevement());
					((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).addAnalyseTabItem(newAnalyse);
				}
			}
		};
		itemEnvoyerCotationSelectionListener = new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				if (((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).isDirty()) {
					MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Attention", "Avant d'envoyer les cotations, vous devez enregistrer le dossier.");
				} else {
					EnvoyerCotationDialog envoyerCotationDialog = new EnvoyerCotationDialog(Display.getCurrent().getActiveShell(), "Envoyer toutes les cotations du numéro d'hospitatlisation " + getPrelevement().getNumSejour(), getPrelevement());
					if (envoyerCotationDialog.open() == IDialogConstants.OK_ID) {
						remplir(PrelevementServiceImpl.getInstance().getPrelevementById(prelevement.getIdPrelevement()));
					}
				}
			}
		};
		selectionChangedComboPresc = new ISelectionChangedListener() {

			public void selectionChanged(SelectionChangedEvent event) {
				Utilisateur presc = null;
				ISelection selectionPresc = comboPrescripteur.getSelection();
				if (!selectionPresc.isEmpty()) {
					IStructuredSelection structuredSelection = (IStructuredSelection) selectionPresc;
					presc = (Utilisateur) structuredSelection.getFirstElement();
				}
				if (presc != null) {
					if (presc.getUf() != null) {
						String[] ufp = presc.getUf().split(";");
						tUFPrescr.setItems(ufp);
					} else {
						tUFPrescr.setItems(new String[0]);
					}

				}
				if (prelevement.getUfPresc() != null) {
					tUFPrescr.setText("" + prelevement.getUfPresc());
				}
			}
		};
		comboTypeEchantillonSelectionChangedListener = new ISelectionChangedListener() {

			public void selectionChanged(SelectionChangedEvent event) {
				TypePrelevement typePrelevementSel = null;
				ISelection selectionTypeEchant = comboTypeEchantillon.getSelection();
				if (!selectionTypeEchant.isEmpty()) {
					IStructuredSelection structuredSelection = (IStructuredSelection) selectionTypeEchant;
					typePrelevementSel = (TypePrelevement) structuredSelection.getFirstElement();
				}
				if (typePrelevementSel != null) {
					int typeP = typePrelevementSel.getIdTypePrelevement();
					// //LA
					if (typeP == 13) {
						if (isModifiable) {
							NbDialog nbtubeDialog = new NbDialog(Display.getCurrent().getActiveShell(), "Nombre de tubes", "Nombre de tubes");
							if (nbtubeDialog.open() == IDialogConstants.OK_ID) {
								nbLA = nbtubeDialog.getNombre();
								if (nbLA <= 0 || nbLA > 10) {
									MessageDialog.openError(Display.getCurrent().getActiveShell(), "Mauvais nombre de tube", "Le nombre de tube doit être un entier positif inf. à 10");
								} else {
									deleteGroupes();

									for (int i = 0; i < nbLA; i++) {
										createGroupLA(i);
										createGroupeBoutonLA();
									}

									if (isModifiable) {
										setModifiableLA();
									}
								}

							}
						} else {
							Champ cnbLA = PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("nbLA", "Prel-" + prelevement.getIdPrelevement());
							if (cnbLA != null) {
								nbLA = Integer.parseInt(cnbLA.getValeur());
							}
						}

						if (btnCheckGarderCultureLA == null) {
							btnCheckGarderCultureLA = new Button(groupCulture, SWT.CHECK);
							btnCheckGarderCultureLA.setText("Garder les cultures");
							btnCheckGarderCultureLA.setFont(boldFont);

							Label lblDateMiseCultLA = new Label(groupCulture, SWT.NONE);
							lblDateMiseCultLA.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
							lblDateMiseCultLA.setFont(boldFont);
							lblDateMiseCultLA.setText("Date de mise en culture :");

							dateMiseEnCultureLA = new FormattedText(groupCulture, SWT.BORDER);
							GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
							gd_dateMiseEnCulture.widthHint = 75;
							dateMiseEnCultureLA.getControl().setLayoutData(gd_dateMiseEnCulture);
							dateMiseEnCultureLA.setFormatter(new DateFormatter("dd/MM/yyyy"));

						}
						groupCulture.setVisible(true);
						((GridData) groupCulture.getLayoutData()).exclude = false;
						gpLA.setVisible(true);
						((GridData) gpLA.getLayoutData()).exclude = false;
						gpF.setVisible(false);
						((GridData) gpF.getLayoutData()).exclude = true;
						gpVC.setVisible(false);
						((GridData) gpVC.getLayoutData()).exclude = true;
						gpS.setVisible(false);
						((GridData) gpS.getLayoutData()).exclude = true;
						gpAD.setVisible(false);
						((GridData) gpAD.getLayoutData()).exclude = true;
						if (isModifiable && bModifierNnbChamp != null && !bModifierNnbChamp.isDisposed()) {
							bModifierNnbChamp.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champLA"));
						} else {
							bModifierNnbChamp.setEnabled(false);
						}
					}
					// //Fibroblastes
					else if (typeP == 5) {
						if (bModifierNnbChamp != null && !bModifierNnbChamp.isDisposed()) {
							bModifierNnbChamp.setEnabled(false);
						}
						createGroupeFibro();
						groupCulture.setVisible(false);
						((GridData) groupCulture.getLayoutData()).exclude = true;
						gpLA.setVisible(false);
						((GridData) gpLA.getLayoutData()).exclude = true;
						gpF.setVisible(true);
						((GridData) gpF.getLayoutData()).exclude = false;
						gpVC.setVisible(false);
						((GridData) gpVC.getLayoutData()).exclude = true;
						gpS.setVisible(false);
						((GridData) gpS.getLayoutData()).exclude = true;
						gpAD.setVisible(false);
						((GridData) gpAD.getLayoutData()).exclude = true;
					} //
						// //VC
					else if (typeP == 4) {
						if (bModifierNnbChamp != null && !bModifierNnbChamp.isDisposed()) {
							bModifierNnbChamp.setEnabled(false);
						}
						if (btnCheckGarderCultureVC == null) {
							btnCheckGarderCultureVC = new Button(groupCulture, SWT.CHECK);
							btnCheckGarderCultureVC.setText("Garder les cultures");
							btnCheckGarderCultureVC.setFont(boldFont);

							Label lblDateMiseCultVC = new Label(groupCulture, SWT.NONE);
							lblDateMiseCultVC.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
							lblDateMiseCultVC.setFont(boldFont);
							lblDateMiseCultVC.setText("Date de mise en culture :");

							dateMiseEnCultureVC = new FormattedText(groupCulture, SWT.BORDER);
							GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
							gd_dateMiseEnCulture.widthHint = 75;
							dateMiseEnCultureVC.getControl().setLayoutData(gd_dateMiseEnCulture);
							dateMiseEnCultureVC.setFormatter(new DateFormatter("dd/MM/yyyy"));

						}

						createGroupeVC();
						groupCulture.setVisible(true);
						((GridData) groupCulture.getLayoutData()).exclude = false;
						gpLA.setVisible(false);
						((GridData) gpLA.getLayoutData()).exclude = true;
						gpF.setVisible(false);
						((GridData) gpF.getLayoutData()).exclude = true;
						gpVC.setVisible(true);
						((GridData) gpVC.getLayoutData()).exclude = false;
						gpS.setVisible(false);
						((GridData) gpS.getLayoutData()).exclude = true;
						gpAD.setVisible(false);
						((GridData) gpAD.getLayoutData()).exclude = true;
					} // //SANG + foetal
					else if (typeP == 1 || typeP == 2) {
						if (isModifiable && nbSang == 0 && nbLA == 0) {
							NbDialog nbtubeDialog = new NbDialog(Display.getCurrent().getActiveShell(), "Nombre de tubes", "Nombre de tubes");
							if (nbtubeDialog.open() == IDialogConstants.OK_ID) {
								nbSang = nbtubeDialog.getNombre();
								if (nbSang <= 0 || nbSang > 10) {
									MessageDialog.openError(Display.getCurrent().getActiveShell(), "Mauvais nombre de tube", "Le nombre de tube doit être un entier positif inf. à 10");
								} else {
									deleteGroupes();
									for (int i = 0; i < nbSang; i++) {
										createGroupeSang(i);
										createGroupeBoutonSang();
									}
									if (isModifiable) {
										setModifiableSang();
									}
								}

							}
						} else {
							Champ cnbSang = PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("nbSang", "Prel-" + prelevement.getIdPrelevement());
							if (cnbSang != null) {
								nbSang = Integer.parseInt(cnbSang.getValeur());
							}
						}
						groupCulture.setVisible(false);
						((GridData) groupCulture.getLayoutData()).exclude = true;
						gpLA.setVisible(false);
						((GridData) gpLA.getLayoutData()).exclude = true;
						gpF.setVisible(false);
						((GridData) gpF.getLayoutData()).exclude = true;
						gpVC.setVisible(false);
						((GridData) gpVC.getLayoutData()).exclude = true;
						gpS.setVisible(true);
						((GridData) gpS.getLayoutData()).exclude = false;
						gpAD.setVisible(false);
						((GridData) gpAD.getLayoutData()).exclude = true;
						if (isModifiable && bModifierNnbChamp != null && !bModifierNnbChamp.isDisposed()) {
							bModifierNnbChamp.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champS"));
						} else {
							bModifierNnbChamp.setEnabled(false);
						}
					} // //ADN
					else if (typeP == 11
							|| (prelevement.getSecteur() != null && (prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_FOETO) || prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_POSTNATAL) || prelevement.getSecteur().getLibelle()
									.equals(ApplicationContexte.SECTEUR_PUCE_PRENATAL)))) {
						createGroupeADN();
						groupCulture.setVisible(false);
						((GridData) groupCulture.getLayoutData()).exclude = true;
						gpLA.setVisible(false);
						((GridData) gpLA.getLayoutData()).exclude = true;
						gpF.setVisible(false);
						((GridData) gpF.getLayoutData()).exclude = true;
						gpVC.setVisible(false);
						((GridData) gpVC.getLayoutData()).exclude = true;
						gpS.setVisible(false);
						((GridData) gpS.getLayoutData()).exclude = true;
						gpAD.setVisible(true);
						((GridData) gpAD.getLayoutData()).exclude = false;
						if (bModifierNnbChamp != null && !bModifierNnbChamp.isDisposed()) {
							bModifierNnbChamp.setEnabled(false);
						}
					} else {
						groupCulture.setVisible(false);
						((GridData) groupCulture.getLayoutData()).exclude = true;
						gpLA.setVisible(false);
						((GridData) gpLA.getLayoutData()).exclude = true;
						gpF.setVisible(false);
						((GridData) gpF.getLayoutData()).exclude = true;
						gpVC.setVisible(false);
						((GridData) gpVC.getLayoutData()).exclude = true;
						gpS.setVisible(false);
						((GridData) gpS.getLayoutData()).exclude = true;
						gpAD.setVisible(false);
						((GridData) gpAD.getLayoutData()).exclude = true;
						if (bModifierNnbChamp != null && !bModifierNnbChamp.isDisposed()) {
							bModifierNnbChamp.setEnabled(false);
						}
					}

				}
				composite_1.pack();
				sc1.redraw();
			}

			private void deleteGroupes() {
				for (Group ssgpLAenCours : ssgpLA) {
					if (ssgpLAenCours != null) {
						ssgpLAenCours.dispose();
					}

				}
				ssgpLA = new ArrayList<Group>();
				for (Group ssgpSenCours : ssgpS) {
					if (ssgpSenCours != null) {
						ssgpSenCours.dispose();
					}
				}
				ssgpS = new ArrayList<Group>();
			}

		};

		addTubeSelectionListener = new SelectionAdapter() {

			@Override
			public void widgetSelected(SelectionEvent e) {
				TypePrelevement typePrelevementSel = null;
				ISelection selectionTypeEchant = comboTypeEchantillon.getSelection();
				if (!selectionTypeEchant.isEmpty()) {
					IStructuredSelection structuredSelection = (IStructuredSelection) selectionTypeEchant;
					typePrelevementSel = (TypePrelevement) structuredSelection.getFirstElement();
				}
				if (typePrelevementSel == null) {
					MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur", "Pour ajouter un tube il faut que le type de prélèvement soit rempli");

				} else {
					if (typePrelevementSel.getLibelle().contains("Sang") || typePrelevementSel.getLibelle().contains("mniotique")) {
						if (typePrelevementSel.getLibelle().contains("Sang")) {
							nbSang += 1;
							if (nbSang <= 0 || nbSang > 10) {
								MessageDialog.openError(Display.getCurrent().getActiveShell(), "Mauvais nombre de tube", "Le nombre de tube doit être un entier positif inf. à 10");
							} else {
								createGroupeSang(nbSang - 1);
								createGroupeBoutonSang();
								if (isModifiable) {
									setModifiableSang();
								}

							}
						}
						if (typePrelevementSel.getLibelle().contains("mniotique")) {
							nbLA += 1;
							if (nbLA <= 0 || nbLA > 10) {
								MessageDialog.openError(Display.getCurrent().getActiveShell(), "Mauvais nombre de tube", "Le nombre de tube doit être un entier positif inf. à 10");
							} else {
								if (btnCheckGarderCultureLA == null) {
									btnCheckGarderCultureLA = new Button(gpLA, SWT.CHECK);
									btnCheckGarderCultureLA.setText("Garder les cultures");
									btnCheckGarderCultureLA.setFont(boldFont);

									Label lblDateMiseCultLA = new Label(gpLA, SWT.NONE);
									lblDateMiseCultLA.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
									lblDateMiseCultLA.setFont(boldFont);
									lblDateMiseCultLA.setText("Date de mise en culture :");

									dateMiseEnCultureLA = new FormattedText(gpLA, SWT.BORDER);
									GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
									gd_dateMiseEnCulture.widthHint = 75;
									dateMiseEnCultureLA.getControl().setLayoutData(gd_dateMiseEnCulture);
									dateMiseEnCultureLA.setFormatter(new DateFormatter("dd/MM/yyyy"));

								}
								createGroupLA(nbLA - 1);
								createGroupeBoutonLA();
								if (isModifiable) {
									setModifiableLA();
								}
							}
						}

						composite_1.pack();
						sc1.redraw();

					} else {
						MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur", "Pour changer le nombre de tube il faut que le type de prélèvement soit du sang ou du liquide amniotique");

					}

				}
			}

		};
		this.isModifiable = modifiable;
		createContent();
	}

	public void createContent() {

		sc1 = new ScrolledComposite(prelevementTabItem.getParent(), SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
		composite_1 = new Composite(sc1, SWT.NONE);
		sc1.setContent(composite_1);
		sc1.getVerticalBar().setIncrement(10);
		sc1.getHorizontalBar().setIncrement(10);
		sc1.setAlwaysShowScrollBars(true);
		prelevementTabItem.setControl(sc1);
		composite_1.setLayout(new GridLayout(4, false));

		ToolBar toolBar = new ToolBar(composite_1, SWT.FLAT | SWT.RIGHT);
		toolBar.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
		itemAddAnalyse = new ToolItem(toolBar, SWT.PUSH);
		itemAddAnalyse.setImage(ResourceManager.getPluginImage("visiopuce", "icons/plusAnalyse.png"));
		itemAddAnalyse.setToolTipText("Ajouter une analyse");
		itemAddAnalyse.setEnabled(false);
		itemAddAnalyse.addSelectionListener(itemAddAnalyseSelectionListener);

		if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "envoyerCotation")) {
			itemEnvoyerCotation = new ToolItem(toolBar, SWT.PUSH);
			itemEnvoyerCotation.setImage(ResourceManager.getPluginImage("visiopuce", "icons/envoyerCotation.png"));
			itemEnvoyerCotation.setToolTipText("Envoyer les cotations pour tous les dossiers ayant le même numéro de séjour.");
			itemEnvoyerCotation.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "envoyerCotation"));
			itemEnvoyerCotation.addSelectionListener(itemEnvoyerCotationSelectionListener);
		}

		lblNom = new Label(composite_1, SWT.NONE);
		lblNom.setFont(boldFont);
		lblNom.setText("Num\u00E9ro de pr\u00E9l\u00E8vement :");

		lblPrenom = new Label(composite_1, SWT.NONE);
		lblPrenom.setFont(boldFont);
		GridData gd_lblPrenom = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_lblPrenom.widthHint = 150;
		lblPrenom.setLayoutData(gd_lblPrenom);

		Label lblNumroDePrlvement = new Label(composite_1, SWT.NONE);
		lblNumroDePrlvement.setFont(boldFont);
		lblNumroDePrlvement.setText("Num\u00E9ro de pr\u00E9l\u00E8vement :");

		tNumeroPrelevement = new Text(composite_1, SWT.BORDER);
		GridData gd_tNumeroPrelevement = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_tNumeroPrelevement.widthHint = 150;
		tNumeroPrelevement.setLayoutData(gd_tNumeroPrelevement);
		tNumeroPrelevement.setEditable(false);

		if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tNumeroPrelevement")) {
			bModifierNumero = new Button(composite_1, SWT.NONE);
			bModifierNumero.setText("Modifier le numéro de prélèvement");
			bModifierNumero.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));

			bModifierNumero.setEnabled(false);
		}

		lblCotationEnvoyee = new Label(composite_1, SWT.NONE);
		lblCotationEnvoyee.setFont(boldFont);
		lblCotationEnvoyee.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));

		Label lblNDeSjour = new Label(composite_1, SWT.NONE);
		lblNDeSjour.setFont(boldFont);
		lblNDeSjour.setText("N\u00B0 de s\u00E9jour (IEP):");

		tNSejour = new FormattedText(composite_1, SWT.BORDER);
		tNSejour.setFormatter(new MaskFormatter("##########"));
		GridData gridData_tNSejour = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gridData_tNSejour.widthHint = 75;
		tNSejour.getControl().setLayoutData(gridData_tNSejour);

		Label lblNumeroUFPresc = new Label(composite_1, SWT.NONE);
		lblNumeroUFPresc.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
		lblNumeroUFPresc.setText("UF prescripteur* :");

		tUFPrescr = new Combo(composite_1, SWT.SINGLE);
		GridData gridData_tUFPrescr = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gridData_tUFPrescr.widthHint = 50;
		tUFPrescr.setLayoutData(gridData_tUFPrescr);

		Label lblPrescripteur = new Label(composite_1, SWT.NONE);
		lblPrescripteur.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
		lblPrescripteur.setText("Prescripteur* :");

		comboPrescripteur = new ComboViewer(composite_1, SWT.DROP_DOWN | SWT.READ_ONLY);
		comboPrescripteur.setContentProvider(ArrayContentProvider.getInstance());
		comboPrescripteur.setLabelProvider(new UtilisateurLabelProvider());
		// fill the list with ComboValue objects
		ArrayList<Utilisateur> listPrescipteurs = UtilisateurServiceImpl.getInstance().getPrescripteurs();
		comboPrescripteur.setInput(listPrescipteurs);
		comboPrescripteur.addSelectionChangedListener(selectionChangedComboPresc);

		Label lblPrescripteur2 = new Label(composite_1, SWT.NONE);
		lblPrescripteur2.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
		lblPrescripteur2.setText("2ème prescripteur :");

		comboPrescripteur2 = new ComboViewer(composite_1, SWT.DROP_DOWN | SWT.READ_ONLY);
		comboPrescripteur2.setContentProvider(ArrayContentProvider.getInstance());
		comboPrescripteur2.setLabelProvider(new UtilisateurLabelProvider());
		// fill the list with ComboValue objects
		comboPrescripteur2.setInput(listPrescipteurs);

		Label lblPrescripteur3 = new Label(composite_1, SWT.NONE);
		lblPrescripteur3.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
		lblPrescripteur3.setText("3ème prescripteur :");

		comboPrescripteur3 = new ComboViewer(composite_1, SWT.DROP_DOWN | SWT.READ_ONLY);
		comboPrescripteur3.setContentProvider(ArrayContentProvider.getInstance());
		comboPrescripteur3.setLabelProvider(new UtilisateurLabelProvider());
		// fill the list with ComboValue objects
		comboPrescripteur3.setInput(listPrescipteurs);

		Label lblNomAutrePresc = new Label(composite_1, SWT.NONE);
		lblNomAutrePresc.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
		lblNomAutrePresc.setText("Nom, prénom (si pas dans la liste) :");
		tNomPrenomAutrePresc = new Text(composite_1, SWT.BORDER);
		GridData gridData_tNomPrenomAutrePresc = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gridData_tNomPrenomAutrePresc.widthHint = 100;
		tNomPrenomAutrePresc.setLayoutData(gridData_tNomPrenomAutrePresc);
		if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tNumeroPrelevement")) {
			if (bModifierNumero == null) {
				bModifierNumero = new Button(composite_1, SWT.NONE);
				bModifierNumero.setText("Modifier le numéro de prélèvement");
				bModifierNumero.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
				bModifierNumero.setEnabled(false);
			}
		} else {
			new Label(composite_1, SWT.NONE);
		}

		// bAjouterNonConformite = new Button(composite_1, SWT.NONE);
		// bAjouterNonConformite.setText("Créer une non conformité");
		// bAjouterNonConformite.setLayoutData(new GridData(SWT.CENTER,
		// SWT.CENTER, false, false, 2, 1));
		// bAjouterNonConformite.addSelectionListener(new
		// GenererNonConformiteListener(this.getPrelevement()));

		Group gpSecteur = new Group(composite_1, SWT.NONE);
		gpSecteur.setText("Secteur*");
		gpSecteur.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));
		selectionSecteurListener = new SelectionSecteurListener(this);
		gpSecteur.setLayout(new GridLayout(3, false));

		btnRadioPrenatal = new Button(gpSecteur, SWT.RADIO);
		btnRadioPrenatal.setText(ApplicationContexte.SECTEUR_PRENATAL);
		btnRadioPrenatal.addSelectionListener(selectionSecteurListener);

		btnRadioPostnatal = new Button(gpSecteur, SWT.RADIO);
		btnRadioPostnatal.setText(ApplicationContexte.SECTEUR_POSTNATAL);
		btnRadioPostnatal.addSelectionListener(selectionSecteurListener);

		btnRadioFoeto = new Button(gpSecteur, SWT.RADIO);
		btnRadioFoeto.setText(ApplicationContexte.SECTEUR_FOETO);
		btnRadioFoeto.addSelectionListener(selectionSecteurListener);

		btnRadioPucesPre = new Button(gpSecteur, SWT.RADIO);
		btnRadioPucesPre.setText(ApplicationContexte.SECTEUR_PUCE_PRENATAL);
		btnRadioPucesPre.addSelectionListener(selectionSecteurListener);

		btnRadioPucesPost = new Button(gpSecteur, SWT.RADIO);
		btnRadioPucesPost.setText(ApplicationContexte.SECTEUR_PUCE_POSTNATAL);
		btnRadioPucesPost.addSelectionListener(selectionSecteurListener);

		btnRadioPucesFoeto = new Button(gpSecteur, SWT.RADIO);
		btnRadioPucesFoeto.setText(ApplicationContexte.SECTEUR_PUCE_FOETO);
		btnRadioPucesFoeto.addSelectionListener(selectionSecteurListener);

		btnRadioBanques = new Button(gpSecteur, SWT.RADIO);
		btnRadioBanques.setText(ApplicationContexte.SECTEUR_BANQUE);
		btnRadioBanques.addSelectionListener(selectionSecteurListener);

		btnRadioCellules = new Button(gpSecteur, SWT.RADIO);
		btnRadioCellules.setText(ApplicationContexte.SECTEUR_CELLULES);
		btnRadioCellules.addSelectionListener(selectionSecteurListener);

		btnCheckDpi = new Button(gpSecteur, SWT.CHECK);
		btnCheckDpi.setText("DPI");

		btnCheckRecherche = new Button(gpSecteur, SWT.CHECK);
		btnCheckRecherche.setText("Recherche");

		Label lblIndication = new Label(gpSecteur, SWT.NONE);
		lblNumroDePrlvement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		lblIndication.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
		lblIndication.setText("Indications* :");

		comboTypeIndication = new ComboViewer(gpSecteur, SWT.DROP_DOWN | SWT.READ_ONLY);
		comboTypeIndication.setContentProvider(ArrayContentProvider.getInstance());
		comboTypeIndication.setLabelProvider(new TypeIndicationLabelProvider());
		comboTypeIndication.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

		Label lblInfoCompl = new Label(gpSecteur, SWT.NONE);
		lblInfoCompl.setText("Informations complémentaires");

		tInfoIndication = new Text(gpSecteur, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
		GridData gd_tInfoIndication = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
		gd_tInfoIndication.widthHint = 250;
		gd_tInfoIndication.heightHint = 96;
		tInfoIndication.setLayoutData(gd_tInfoIndication);

		groupCulture = new Group(composite_1, SWT.DROP_DOWN | SWT.READ_ONLY);
		groupCulture.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
		groupCulture.setText("Culture");
		groupCulture.setLayout(new GridLayout(4, false));

		groupEchantillon = new Group(composite_1, SWT.DROP_DOWN | SWT.READ_ONLY);
		groupEchantillon.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
		groupEchantillon.setText("Echantillon");
		groupEchantillon.setLayout(new GridLayout(4, false));

		Label lblTypeDchantillon = new Label(groupEchantillon, SWT.NONE);
		lblTypeDchantillon.setFont(boldFont);
		lblTypeDchantillon.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
		lblTypeDchantillon.setText("Type d'\u00E9chantillon* :");

		comboTypeEchantillon = new ComboViewer(groupEchantillon, SWT.DROP_DOWN | SWT.READ_ONLY);
		comboTypeEchantillon.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
		comboTypeEchantillon.setContentProvider(ArrayContentProvider.getInstance());
		comboTypeEchantillon.setLabelProvider(new TypePrelevementLabelProvider());
		comboTypeEchantillon.addSelectionChangedListener(comboTypeEchantillonSelectionChangedListener);

		Label lblDateDePrelev = new Label(groupEchantillon, SWT.NONE);
		lblDateDePrelev.setFont(boldFont);
		lblDateDePrelev.setText("Date de pr\u00E9lèvement** :");

		datePrelev = new FormattedText(groupEchantillon, SWT.BORDER);
		GridData gd_datePrelev = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_datePrelev.widthHint = 75;
		datePrelev.getControl().setLayoutData(gd_datePrelev);
		datePrelev.setFormatter(new DateFormatter("dd/MM/yyyy"));

		Label lblDateDeRception = new Label(groupEchantillon, SWT.NONE);
		lblDateDeRception.setFont(boldFont);
		lblDateDeRception.setText("Date de r\u00E9ception** :");

		dateReception = new FormattedText(groupEchantillon, SWT.BORDER);
		GridData gd_dateReception = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_dateReception.widthHint = 75;
		dateReception.getControl().setLayoutData(gd_dateReception);
		dateReception.setFormatter(new DateFormatter("dd/MM/yyyy"));

		Label lblCetchantillonEst = new Label(groupEchantillon, SWT.NONE);
		lblCetchantillonEst.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 2, 1));
		lblCetchantillonEst.setFont(boldFont);
		lblCetchantillonEst.setText("Cet \u00E9chantillon est un d\u00E9riv\u00E9 du pr\u00E9l\u00E8vement :");

		comboDerive = new ComboViewer(groupEchantillon, SWT.READ_ONLY);
		comboDerive.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
		comboDerive.setContentProvider(ArrayContentProvider.getInstance());
		comboDerive.setLabelProvider(new PrelevementLabelProvider());

		gpLA = new Group(groupEchantillon, SWT.NONE);
		gpLA.setLayout(new GridLayout(4, false));
		gpLA.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		gpVC = new Group(groupEchantillon, SWT.NONE);
		gpVC.setLayout(new GridLayout(4, false));
		gpVC.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		// createGroupeVC();

		gpS = new Group(groupEchantillon, SWT.NONE);
		gpS.setLayout(new GridLayout(4, false));
		gpS.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		gpF = new Group(groupEchantillon, SWT.NONE);
		gpF.setLayout(new GridLayout(4, false));
		gpF.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		// createGroupeFibro();

		gpAD = new Group(groupEchantillon, SWT.NONE);
		gpAD.setLayout(new GridLayout(4, false));
		gpAD.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		// createGroupeADN();
		groupCulture.setVisible(false);
		((GridData) groupCulture.getLayoutData()).exclude = true;
		gpLA.setVisible(false);
		((GridData) gpLA.getLayoutData()).exclude = true;
		gpF.setVisible(false);
		((GridData) gpF.getLayoutData()).exclude = true;
		gpVC.setVisible(false);
		((GridData) gpVC.getLayoutData()).exclude = true;
		gpS.setVisible(false);
		((GridData) gpS.getLayoutData()).exclude = true;
		gpAD.setVisible(false);
		((GridData) gpAD.getLayoutData()).exclude = true;

		// createPrenatal();

		setModifiable(isModifiable);
		prelevementTabItem.getParent().setSelection(prelevementTabItem);
	}

	private void createGroupeADN() {

		if (btnCheckExtraction == null) {
			btnCheckExtraction = new Button(gpAD, SWT.CHECK);
			btnCheckExtraction.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 2, 1));
			btnCheckExtraction.setFont(boldFont);
			btnCheckExtraction.setText("Extraction, date");

			dateExtraction = new FormattedText(gpAD, SWT.BORDER);
			GridData gd_dateExtraction = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
			gd_dateExtraction.widthHint = 75;
			dateExtraction.getControl().setLayoutData(gd_dateExtraction);
			dateExtraction.setFormatter(new DateFormatter("dd/MM/yyyy"));

			Label lblConsentrationADN = new Label(gpAD, SWT.NONE);
			lblConsentrationADN.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblConsentrationADN.setFont(boldFont);
			lblConsentrationADN.setText("Concentration (ng/μL) :");

			tConcentrationADN = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_tConcentrationADN = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tConcentrationADN.widthHint = 150;
			tConcentrationADN.getControl().setLayoutData(gridData_tConcentrationADN);
			tConcentrationADN.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lbl260_280 = new Label(gpAD, SWT.NONE);
			lbl260_280.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lbl260_280.setFont(boldFont);
			lbl260_280.setText("260/280 :");

			t260_280 = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_t260_280 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_t260_280.widthHint = 150;
			t260_280.getControl().setLayoutData(gridData_t260_280);
			t260_280.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lbl260_230 = new Label(gpAD, SWT.NONE);
			lbl260_230.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lbl260_230.setFont(boldFont);
			lbl260_230.setText("260/230 :");

			t260_230 = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_t260_230 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_t260_230.widthHint = 150;
			t260_230.getControl().setLayoutData(gridData_t260_230);
			t260_230.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblAE = new Label(gpAD, SWT.NONE);
			lblAE.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblAE.setFont(boldFont);
			lblAE.setText("AE (μL) :");

			tAE = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_tAE = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tAE.widthHint = 150;
			tAE.getControl().setLayoutData(gridData_tAE);
			tAE.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblvolADN = new Label(gpAD, SWT.NONE);
			lblvolADN.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblvolADN.setFont(boldFont);
			lblvolADN.setText("Volume de sang (mL):");

			tVolADN = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_tVolADN = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tVolADN.widthHint = 150;
			tVolADN.getControl().setLayoutData(gridData_tVolADN);
			tVolADN.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblRangADN = new Label(gpAD, SWT.NONE);
			lblRangADN.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblRangADN.setFont(boldFont);
			lblRangADN.setText("Rangement :");

			tRangementADN = new Text(gpAD, SWT.BORDER);
			GridData gridData_tRangementADN = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tRangementADN.widthHint = 150;
			tRangementADN.setLayoutData(gridData_tRangementADN);

			btnCheckPurification = new Button(gpAD, SWT.CHECK);
			btnCheckPurification.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 2, 1));
			btnCheckPurification.setFont(boldFont);
			btnCheckPurification.setText("Purification, date");

			datePurification = new FormattedText(gpAD, SWT.BORDER);
			GridData gd_datePurification = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
			gd_datePurification.widthHint = 75;
			datePurification.getControl().setLayoutData(gd_datePurification);
			datePurification.setFormatter(new DateFormatter("dd/MM/yyyy"));

			Label lblConsentrationADNpurif = new Label(gpAD, SWT.NONE);
			lblConsentrationADNpurif.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblConsentrationADNpurif.setFont(boldFont);
			lblConsentrationADNpurif.setText("Concentration (ng/μL) :");

			tConcentrationADNpurif = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_tConcentrationADNPurif = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tConcentrationADNPurif.widthHint = 150;
			tConcentrationADNpurif.getControl().setLayoutData(gridData_tConcentrationADNPurif);
			tConcentrationADNpurif.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lbl260_280Purif = new Label(gpAD, SWT.NONE);
			lbl260_280Purif.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lbl260_280Purif.setFont(boldFont);
			lbl260_280Purif.setText("260/280 :");

			t260_280purif = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_t260_280purif = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_t260_280purif.widthHint = 150;
			t260_280purif.getControl().setLayoutData(gridData_t260_280purif);
			t260_280purif.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lbl260_230purif = new Label(gpAD, SWT.NONE);
			lbl260_230purif.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lbl260_230purif.setFont(boldFont);
			lbl260_230purif.setText("260/230 :");

			t260_230purif = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_t260_230purif = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_t260_230purif.widthHint = 150;
			t260_230purif.getControl().setLayoutData(gridData_t260_230);
			t260_230purif.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblAEpurif = new Label(gpAD, SWT.NONE);
			lblAEpurif.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblAEpurif.setFont(boldFont);
			lblAEpurif.setText("AE (μL) :");

			tAEpurif = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_tAEpurif = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tAEpurif.widthHint = 150;
			tAEpurif.getControl().setLayoutData(gridData_tAE);
			tAEpurif.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblvolADNpurif = new Label(gpAD, SWT.NONE);
			lblvolADNpurif.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblvolADNpurif.setFont(boldFont);
			lblvolADNpurif.setText("Volume de sang (mL):");

			tVolADNpurif = new FormattedText(gpAD, SWT.BORDER);
			GridData gridData_tVolADNpurif = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tVolADNpurif.widthHint = 150;
			tVolADNpurif.getControl().setLayoutData(gridData_tVolADN);
			tVolADNpurif.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblRangADNpurif = new Label(gpAD, SWT.NONE);
			lblRangADNpurif.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblRangADNpurif.setFont(boldFont);
			lblRangADNpurif.setText("Rangement :");

			tRangementADNpurif = new Text(gpAD, SWT.BORDER);
			GridData gridData_tRangementADNpurif = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_tRangementADNpurif.widthHint = 150;
			tRangementADNpurif.setLayoutData(gridData_tRangementADN);

			// btnCheckDilution = new Button(gpAD, SWT.CHECK);
			// btnCheckDilution.setLayoutData(new GridData(SWT.RIGHT,
			// SWT.CENTER,
			// true, false, 2, 1));
			// btnCheckDilution.setFont(boldFont);
			// btnCheckDilution.setText("Dilution, date");
			//
			// dateDilution = new FormattedText(gpAD, SWT.BORDER);
			// GridData gd_dateDilution = new GridData(SWT.LEFT, SWT.CENTER,
			// false,
			// false, 2, 1);
			// gd_dateDilution.widthHint = 75;
			// dateDilution.getControl().setLayoutData(gd_dateDilution);
			// dateDilution.setFormatter(new DateFormatter("dd/MM/yyyy"));

			gpEnvoiADN = new Group(gpAD, SWT.NONE);
			gpEnvoiADN.setLayout(new GridLayout(4, false));
			gpEnvoiADN.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

			btnEnvoyerADN = new Button(gpEnvoiADN, SWT.NONE);
			btnEnvoyerADN.setText("Envoyer");

			btnEnvoyerADN.addSelectionListener(new SelectionAdapter() {

				@Override
				public void widgetSelected(SelectionEvent e) {
					Champ cnbEnvoiADN = PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("nbEnvoiADN", "Prel-" + prelevement.getIdPrelevement());
					if (cnbEnvoiADN != null) {
						nbEnvoiADN = Integer.parseInt(cnbEnvoiADN.getValeur());
					}
					nbEnvoiADN += 1;

					createGroupeEnvoiADN(nbEnvoiADN - 1);
					if (isModifiable) {
						setModifiableEnvoiADN();
					}

				}

			});
		}
		gpAD.setVisible(true);
		((GridData) gpAD.getLayoutData()).exclude = false;

		composite_1.pack();
		sc1.redraw();

	}

	private void createGroupeFibro() {
		if (comboVolFibro == null) {
			Label lblvolF = new Label(gpF, SWT.NONE);
			lblvolF.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblvolF.setFont(boldFont);
			lblvolF.setText("Volume :");

			comboVolFibro = new Combo(gpF, SWT.READ_ONLY);
			comboVolFibro.setItems(ApplicationContexte.quantiteFibro);

			Label lblAspF = new Label(gpF, SWT.NONE);
			lblAspF.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblAspF.setFont(boldFont);
			lblAspF.setText("Aspect :");

			comboAspectFibro = new Combo(gpF, SWT.READ_ONLY);
			comboAspectFibro.setItems(ApplicationContexte.qualiteFibro);

			Label lblDateMiseCultF = new Label(gpF, SWT.NONE);
			lblDateMiseCultF.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
			lblDateMiseCultF.setFont(boldFont);
			lblDateMiseCultF.setText("Date de mise en culture :");

			dateMiseEnCultureF = new FormattedText(gpF, SWT.BORDER);
			GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
			gd_dateMiseEnCulture.widthHint = 75;
			dateMiseEnCultureF.getControl().setLayoutData(gd_dateMiseEnCulture);
			dateMiseEnCultureF.setFormatter(new DateFormatter("dd/MM/yyyy"));

			bGenererFeuilleCultureF = new Button(gpF, SWT.NONE);
			bGenererFeuilleCultureF.setText("Générer les feuilles de culture");
			bGenererFeuilleCultureF.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
			bGenererFeuilleCultureF.addSelectionListener(new GenererCultureListener(this, "F", "Foetopathologie"));

			// setModifiable(isModifiable);
		}
		gpF.setVisible(true);
		((GridData) gpF.getLayoutData()).exclude = false;

		composite_1.pack();
		sc1.redraw();
	}

	private void createGroupeEnvoiADN(final int i) {

		Group g = new Group(gpEnvoiADN, SWT.NONE);
		g.setText("Envoi n°" + (i + 1));
		g.setLayout(new GridLayout(4, false));
		g.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		Label lbldem = new Label(g, SWT.NONE);
		lbldem.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lbldem.setFont(boldFont);
		lbldem.setText("Demandeur :");

		comboDemandeur.add(i, new ComboViewer(g, SWT.DROP_DOWN | SWT.READ_ONLY));
		comboDemandeur.get(i).setContentProvider(ArrayContentProvider.getInstance());
		comboDemandeur.get(i).setLabelProvider(new UtilisateurLabelProvider());
		// fill the list with ComboValue objects
		ArrayList<Utilisateur> listDemandeurs = UtilisateurServiceImpl.getInstance().getPrescripteurs();
		Utilisateur puer1 = UtilisateurServiceImpl.getInstance().getUtilisateurByNom("Lacombe");
		listDemandeurs.add(puer1);
		Utilisateur puer2 = UtilisateurServiceImpl.getInstance().getUtilisateurByNom("Chevalier");
		listDemandeurs.add(puer2);
		comboDemandeur.get(i).setInput(listDemandeurs);

		Label lblDateDemande = new Label(g, SWT.NONE);
		lblDateDemande.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblDateDemande.setFont(boldFont);
		lblDateDemande.setText("Date de la demande :");

		dateDemande.add(i, new FormattedText(g, SWT.BORDER));
		GridData gd_dateDemande = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_dateDemande.widthHint = 75;
		dateDemande.get(i).getControl().setLayoutData(gd_dateDemande);
		dateDemande.get(i).setFormatter(new DateFormatter("dd/MM/yyyy"));

		Label lblDateEnvoi = new Label(g, SWT.NONE);
		lblDateEnvoi.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblDateEnvoi.setFont(boldFont);
		lblDateEnvoi.setText("Date d'envoi :");

		dateEnvoi.add(i, new FormattedText(g, SWT.BORDER));
		GridData gd_dateEnvoi = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_dateEnvoi.widthHint = 75;
		dateEnvoi.get(i).getControl().setLayoutData(gd_dateEnvoi);
		dateEnvoi.get(i).setFormatter(new DateFormatter("dd/MM/yyyy"));

		Label lblVolE = new Label(g, SWT.NONE);
		lblVolE.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblVolE.setFont(boldFont);
		lblVolE.setText("Volume envoyé (en µL) :");

		tVolEnvoye.add(i, new FormattedText(g, SWT.BORDER));
		GridData gridData_tVolEnvoye = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
		gridData_tVolEnvoye.widthHint = 150;
		tVolEnvoye.get(i).getControl().setLayoutData(gridData_tVolEnvoye);
		tVolEnvoye.get(i).setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

		btnFormulaireEnvoi.add(i, new Button(g, SWT.BORDER));
		GridData gridData_btnFormulaireEnvoi = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
		gridData_tVolEnvoye.widthHint = 150;
		btnFormulaireEnvoi.get(i).setLayoutData(gridData_btnFormulaireEnvoi);
		btnFormulaireEnvoi.get(i).setText("Formulaire d'envoi d'ADN");
		btnFormulaireEnvoi.get(i).addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				if (((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).isDirty()) {
					MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Attention", "Avant de générer le document vous devez enregistrer le dossier.");
				} else {
					String repResultat = "";
					SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
					if (Character.isDigit(prelevement.getNumeroPrelevement().charAt(1))) {
						repResultat = ApplicationContexte.REPERTOIRE_RESULTAT + "activité 20" + prelevement.getNumeroPrelevement().substring(1, 3) + "\\" + prelevement.getNumeroPrelevement().substring(0, 1) + "\\";
					} else {
						if (Character.isDigit(prelevement.getNumeroPrelevement().charAt(2))) {
							repResultat = ApplicationContexte.REPERTOIRE_RESULTAT + "activité 20" + prelevement.getNumeroPrelevement().substring(2, 4) + "\\" + prelevement.getNumeroPrelevement().substring(0, 2) + "\\";
						}
					}
					Personne personne = PersonneServiceImpl.getInstance().getPersonneById(prelevement.getPersonne().getIdPersonne());
					File fileout = new File(repResultat + prelevement.getNumeroPrelevement() + "_" + personne.getNom() + "_" + personne.getPrenom() + "_envoiADN_" + "_" + formatter.format(dateEnvoi.get(i).getValue()) + ".docx");
					boolean creer = true;
					if (fileout.exists()) {
						creer = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Fichier existant", "Le fichier " + fileout.getName() + " existe déjà souhaitez vous l'écraser (oui) ou l'ouvrir (annuler)?");
					}
					if (creer) {
						EnvoiADN envoiADN = new EnvoiADN();
						envoiADN.createDocument(recupererObjet(), i);
					} else {

						Desktop desktop = Desktop.getDesktop();
						fileout.setWritable(true);
						try {
							desktop.open(fileout);
						} catch (IOException e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						}

					}
				}
			}
		});

		gpAD.setVisible(true);
		((GridData) gpAD.getLayoutData()).exclude = false;

		composite_1.pack();
		sc1.redraw();
	}

	private void createGroupeBoutonSang() {

		if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champSang")) {
			if (bModifierNnbChamp == null) {
				bModifierNnbChamp = new Button(groupEchantillon, SWT.NONE);
				bModifierNnbChamp.setText("Ajouter un tube/falcon");
				bModifierNnbChamp.setFont(boldFont);
				bModifierNnbChamp.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
				bModifierNnbChamp.setEnabled(isModifiable());
			}

			if (bGenererFeuilleCultureS == null) {
				bGenererFeuilleCultureS = new Button(groupEchantillon, SWT.NONE);
				bGenererFeuilleCultureS.setText("Générer la feuille de culture");
				bGenererFeuilleCultureS.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
				bGenererFeuilleCultureS.addSelectionListener(new GenererCultureListener(this, "S", "Postnatal"));
			}
		}

	}

	private void createGroupeBoutonLA() {
		if (bModifierNnbChamp == null) {
			if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champLA")) {
				bModifierNnbChamp = new Button(groupEchantillon, SWT.NONE);
				bModifierNnbChamp.setText("Ajouter un tube/falcon");
				bModifierNnbChamp.setFont(boldFont);
				bModifierNnbChamp.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
				bModifierNnbChamp.setEnabled(isModifiable());
			}
			if (bGenererFeuilleCultureLA == null) {
				bGenererFeuilleCultureLA = new Button(groupEchantillon, SWT.NONE);
				bGenererFeuilleCultureLA.setFont(boldFont);
				bGenererFeuilleCultureLA.setText("Générer la feuille de suivi de culture");
				bGenererFeuilleCultureLA.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
				bGenererFeuilleCultureLA.addSelectionListener(new GenererCultureListener(PrelevementTabItem.this, "LA", "Prénatal"));
			}
		}
	}

	private void createGroupeSang(final int i) {

		Group g = new Group(gpS, SWT.NONE);
		g.setText("tube n°" + (i + 1));
		g.setLayout(new GridLayout(4, false));
		g.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));
		ssgpS.add(i, g);

		Label lblTube = new Label(ssgpS.get(i), SWT.NONE);
		lblTube.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblTube.setFont(boldFont);
		lblTube.setText("Tube :");

		Combo c = new Combo(ssgpS.get(i), SWT.READ_ONLY);
		c.setItems(ApplicationContexte.tubeSang);
		c.addSelectionListener(new SelectionListener() {

			public void widgetDefaultSelected(SelectionEvent e) {

			}

			public void widgetSelected(SelectionEvent e) {
				if (comboTube.get(i).getSelectionIndex() != -1) {
					if (ApplicationContexte.tubeSang[comboTube.get(i).getSelectionIndex()].equals("autre")) {
						lblASpeTube.get(i).setVisible(true);
						tASpecifierTube.get(i).setVisible(true);
					}
				} else {
					lblASpeTube.get(i).setVisible(false);
					tASpecifierTube.get(i).setVisible(false);
				}
				ssgpS.get(i).pack();
				groupEchantillon.pack();
				composite_1.pack();
			}
		});
		comboTube.add(i, c);
		Label l = new Label(ssgpS.get(i), SWT.NONE);
		l.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		l.setFont(boldFont);
		l.setText("A spécifier :");
		lblASpeTube.add(i, l);

		tASpecifierTube.add(i, new Text(ssgpS.get(i), SWT.BORDER));

		lblASpeTube.get(i).setVisible(false);
		tASpecifierTube.get(i).setVisible(false);

		Label lblVolS = new Label(ssgpS.get(i), SWT.NONE);
		lblVolS.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblVolS.setFont(boldFont);
		lblVolS.setText("Volume :");

		comboVolSang.add(i, new Combo(ssgpS.get(i), SWT.READ_ONLY));
		comboVolSang.get(i).setItems(ApplicationContexte.quantiteSang);

		Label lblAspectS = new Label(ssgpS.get(i), SWT.NONE);
		lblAspectS.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblAspectS.setFont(boldFont);
		lblAspectS.setText("Aspect :");

		comboAspectSang.add(i, new Combo(ssgpS.get(i), SWT.READ_ONLY));
		comboAspectSang.get(i).setItems(ApplicationContexte.qualiteSang);

		Label lblRangement = new Label(ssgpS.get(i), SWT.NONE);
		lblRangement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblRangement.setFont(boldFont);
		lblRangement.setText("Rangement :");

		tRangementSang.add(i, new Text(ssgpS.get(i), SWT.BORDER));

		btnCheckEnvoye.add(i, new Button(ssgpS.get(i), SWT.CHECK));
		btnCheckEnvoye.get(i).setText("Tube utilisé/envoyé");
		btnCheckEnvoye.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 4, 1));
		btnCheckEnvoye.get(i).addSelectionListener(new SelectionListener() {

			public void widgetDefaultSelected(SelectionEvent e) {

			}

			public void widgetSelected(SelectionEvent e) {
				if (btnCheckEnvoye.get(i).getSelection()) {
					raisonEnvoi.get(i).setVisible(true);
					tCommentaireEnvoi.get(i).setVisible(true);
				} else {
					raisonEnvoi.get(i).setVisible(false);
					tCommentaireEnvoi.get(i).setVisible(false);
				}
				ssgpS.get(i).pack();
				groupEchantillon.pack();
				composite_1.pack();
			}
		});

		raisonEnvoi.add(i, new Label(ssgpS.get(i), SWT.NONE));
		raisonEnvoi.get(i).setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
		raisonEnvoi.get(i).setFont(boldFont);
		raisonEnvoi.get(i).setText("Pourquoi, à qui, quand :");
		tCommentaireEnvoi.add(i, new Text(ssgpS.get(i), SWT.BORDER));
		GridData gridData_tCommentaireEnvoi = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
		gridData_tCommentaireEnvoi.heightHint = 150;
		tCommentaireEnvoi.get(i).setLayoutData(gridData_tCommentaireEnvoi);

		raisonEnvoi.get(i).setVisible(false);
		tCommentaireEnvoi.get(i).setVisible(false);

		Label lblDateMiseCultF = new Label(ssgpS.get(i), SWT.NONE);
		lblDateMiseCultF.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblDateMiseCultF.setFont(boldFont);
		lblDateMiseCultF.setText("Date de mise en culture :");

		dateMiseEnCultureS.add(i, new FormattedText(ssgpS.get(i), SWT.BORDER));
		GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
		gd_dateMiseEnCulture.widthHint = 75;
		dateMiseEnCultureS.get(i).getControl().setLayoutData(gd_dateMiseEnCulture);
		dateMiseEnCultureS.get(i).setFormatter(new DateFormatter("dd/MM/yyyy"));

		if (DroitServiceImpl.getInstance().peutSupprimerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champSang")) {
			bSupS.add(i, new Button(ssgpS.get(i), SWT.NONE));
			bSupS.get(i).setText("Supprimer le tube");
			bSupS.get(i).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
			bSupS.get(i).addSelectionListener(new SelectionListener() {

				@Override
				public void widgetSelected(SelectionEvent e) {
					nbSang--;
					ssgpS.get(i).dispose();
					gpS.pack();
					gpS.getParent().pack();
					gpS.getParent().getParent().pack();
				}

				@Override
				public void widgetDefaultSelected(SelectionEvent e) {
					// TODO Auto-generated method stub

				}
			});
			bSupS.get(i).setEnabled(false);
		}

		// setModifiable(isModifiable);
		ssgpS.get(i).setVisible(true);
		((GridData) ssgpS.get(i).getLayoutData()).exclude = false;

		gpS.setVisible(true);
		((GridData) gpS.getLayoutData()).exclude = false;

		composite_1.pack();
		sc1.redraw();
	}

	private void createGroupeVC() {
		Label lblvolVC = new Label(gpVC, SWT.NONE);
		lblvolVC.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblvolVC.setFont(boldFont);
		lblvolVC.setText("Volume :");

		comboVolVC = new Combo(gpVC, SWT.READ_ONLY);
		comboVolVC.setItems(ApplicationContexte.quantiteVC);
		new Label(gpVC, SWT.NONE);
		new Label(gpVC, SWT.NONE);

		Label lblAspectMacro = new Label(gpVC, SWT.NONE);
		lblAspectMacro.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblAspectMacro.setFont(boldFont);
		lblAspectMacro.setText("Aspect macroscopique :");

		int i = 0;
		for (String qualiteMacroVC : ApplicationContexte.qualiteMacroVC) {
			comboAspectMacroVC[i] = new Button(gpVC, SWT.CHECK);
			comboAspectMacroVC[i].setText(qualiteMacroVC);
			i++;
		}

		lblASpeAspectMacroVC = new Label(gpVC, SWT.NONE);
		lblASpeAspectMacroVC.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblASpeAspectMacroVC.setFont(boldFont);
		lblASpeAspectMacroVC.setText("A spécifier :");

		tASpecifierAspectMacroVC = new Text(gpVC, SWT.BORDER);
		GridData gridData_tASpecifierAspectMacroVC = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
		gridData_tASpecifierAspectMacroVC.widthHint = 150;
		tASpecifierAspectMacroVC.setLayoutData(gridData_tASpecifierAspectMacroVC);

		Label lblAspectMicroVC = new Label(gpVC, SWT.NONE);
		lblAspectMicroVC.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblAspectMicroVC.setFont(boldFont);
		lblAspectMicroVC.setText("Aspect microscopique :");

		int j = 0;
		for (String qualiteMicroVC : ApplicationContexte.qualiteMicroVC) {
			comboAspectMicroVC[j] = new Button(gpVC, SWT.CHECK);
			comboAspectMicroVC[j].setText(qualiteMicroVC);
			j++;
		}

		lblASpeAspectMicroVC = new Label(gpVC, SWT.NONE);
		lblASpeAspectMicroVC.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblASpeAspectMicroVC.setFont(boldFont);
		lblASpeAspectMicroVC.setText("A spécifier :");
		tASpecifierAspectMicroVC = new Text(gpVC, SWT.BORDER);
		GridData gridData_tASpecifierAspectMicroVC = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
		gridData_tASpecifierAspectMicroVC.widthHint = 150;
		tASpecifierAspectMicroVC.setLayoutData(gridData_tASpecifierAspectMicroVC);

		bGenererFeuilleCultureVC = new Button(gpVC, SWT.NONE);
		bGenererFeuilleCultureVC.setText("Générer la feuille de suivi de culture");
		bGenererFeuilleCultureVC.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
		bGenererFeuilleCultureVC.addSelectionListener(new GenererCultureListener(this, "VC", "Prénatal"));

		// setModifiable(isModifiable);

		gpVC.setVisible(true);
		((GridData) gpVC.getLayoutData()).exclude = false;

		composite_1.pack();
		sc1.redraw();
	}

	protected void createGroupLA(final int i) {

		ssgpLA.add(i, new Group(gpLA, SWT.NONE));
		ssgpLA.get(i).setText("tube/falcon n°" + (i + 1));
		ssgpLA.get(i).setLayout(new GridLayout(4, false));
		ssgpLA.get(i).setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		lblVolLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblVolLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblVolLA.get(i).setFont(boldFont);
		lblVolLA.get(i).setText("Volume :");

		comboVolLA.add(i, new Combo(ssgpLA.get(i), SWT.READ_ONLY));
		comboVolLA.get(i).setItems(ApplicationContexte.quantiteLA);
		comboVolLA.get(i).addSelectionListener(new SelectionListener() {

			public void widgetDefaultSelected(SelectionEvent e) {

			}

			public void widgetSelected(SelectionEvent e) {
				if (ApplicationContexte.quantiteLA[comboVolLA.get(i).getSelectionIndex()].equals(">20 mL")) {
					lblASpeVolLA.get(i).setVisible(true);
					tASpecifierVolLA.get(i).setVisible(true);
				} else {
					lblASpeVolLA.get(i).setVisible(false);
					tASpecifierVolLA.get(i).setVisible(false);
				}
				ssgpLA.get(i).pack();
				groupEchantillon.pack();
				composite_1.pack();
			}
		});

		lblASpeVolLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblASpeVolLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblASpeVolLA.get(i).setFont(boldFont);
		lblASpeVolLA.get(i).setText("A spécifier :");
		tASpecifierVolLA.add(i, new Text(ssgpLA.get(i), SWT.BORDER));
		GridData gridData_tASpecifierVolLA = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
		gridData_tASpecifierVolLA.widthHint = 150;
		tASpecifierVolLA.get(i).setLayoutData(gridData_tASpecifierVolLA);

		lblASpeVolLA.get(i).setVisible(false);
		tASpecifierVolLA.get(i).setVisible(false);

		lblAspectLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblAspectLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblAspectLA.get(i).setFont(boldFont);
		lblAspectLA.get(i).setText("Aspect du prélèvement :");

		comboAspectLA.add(i, new Combo(ssgpLA.get(i), SWT.READ_ONLY));
		comboAspectLA.get(i).setItems(ApplicationContexte.qualiteLA);
		comboAspectLA.get(i).addSelectionListener(new SelectionListener() {

			public void widgetDefaultSelected(SelectionEvent e) {

			}

			public void widgetSelected(SelectionEvent e) {
				if (ApplicationContexte.qualiteLA[comboAspectLA.get(i).getSelectionIndex()].equals("autre")) {
					lblASpeAspectLA.get(i).setVisible(true);
					tASpecifierAspectLA.get(i).setVisible(true);
				} else {
					lblASpeAspectLA.get(i).setVisible(false);
					tASpecifierAspectLA.get(i).setVisible(false);
				}
				ssgpLA.get(i).pack();
				gpLA.pack();
				groupEchantillon.pack();
				composite_1.pack();
			}
		});

		lblASpeAspectLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblASpeAspectLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblASpeAspectLA.get(i).setFont(boldFont);
		lblASpeAspectLA.get(i).setText("A spécifier :");
		tASpecifierAspectLA.add(i, new Text(ssgpLA.get(i), SWT.BORDER));
		GridData gridData_tASpecifierAspectLA = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
		gridData_tASpecifierAspectLA.widthHint = 150;
		tASpecifierAspectLA.get(i).setLayoutData(gridData_tASpecifierAspectLA);

		lblASpeAspectLA.get(i).setVisible(false);
		tASpecifierAspectLA.get(i).setVisible(false);

		lblVolCulotLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblVolCulotLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblVolCulotLA.get(i).setFont(boldFont);
		lblVolCulotLA.get(i).setText("Volume du culot :");

		comboVolCulotLA.add(i, new Combo(ssgpLA.get(i), SWT.READ_ONLY));
		comboVolCulotLA.get(i).setItems(ApplicationContexte.quantiteCulot);

		new Label(ssgpLA.get(i), SWT.NONE);
		new Label(ssgpLA.get(i), SWT.NONE);

		lblAspectCulotLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblAspectCulotLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblAspectCulotLA.get(i).setFont(boldFont);
		lblAspectCulotLA.get(i).setText("Aspect du culot :");

		comboAspectCulotLA.add(i, new Combo(ssgpLA.get(i), SWT.READ_ONLY));
		comboAspectCulotLA.get(i).setItems(ApplicationContexte.qualiteCulot);
		comboAspectCulotLA.get(i).addSelectionListener(new SelectionListener() {

			public void widgetDefaultSelected(SelectionEvent e) {

			}

			public void widgetSelected(SelectionEvent e) {
				if (ApplicationContexte.qualiteCulot[comboAspectCulotLA.get(i).getSelectionIndex()].equals("autre")) {
					lblASpeAspectCulotLA.get(i).setVisible(true);
					tASpecifierAspectCulotLA.get(i).setVisible(true);
				} else {
					lblASpeAspectCulotLA.get(i).setVisible(false);
					tASpecifierAspectCulotLA.get(i).setVisible(false);
				}
				ssgpLA.get(i).pack();
				gpLA.pack();
				groupEchantillon.pack();
				composite_1.pack();
			}
		});
		lblASpeAspectCulotLA.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		lblASpeAspectCulotLA.get(i).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
		lblASpeAspectCulotLA.get(i).setFont(boldFont);
		lblASpeAspectCulotLA.get(i).setText("A spécifier :");
		tASpecifierAspectCulotLA.add(i, new Text(ssgpLA.get(i), SWT.BORDER));
		GridData gridData_tASpecifierAspectCulotLA = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
		gridData_tASpecifierAspectCulotLA.widthHint = 150;
		tASpecifierAspectCulotLA.get(i).setLayoutData(gridData_tASpecifierAspectCulotLA);

		lblASpeAspectCulotLA.get(i).setVisible(false);
		tASpecifierAspectCulotLA.get(i).setVisible(false);

		btnCheckEnvoye.add(i, new Button(ssgpLA.get(i), SWT.CHECK));
		btnCheckEnvoye.get(i).setText("Tube utilisé/envoyé");
		btnCheckEnvoye.get(i).setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));
		btnCheckEnvoye.get(i).addSelectionListener(new SelectionListener() {

			public void widgetDefaultSelected(SelectionEvent e) {

			}

			public void widgetSelected(SelectionEvent e) {
				if (btnCheckEnvoye.get(i).getSelection()) {
					raisonEnvoi.get(i).setVisible(true);
					tCommentaireEnvoi.get(i).setVisible(true);
				} else {
					raisonEnvoi.get(i).setVisible(false);
					tCommentaireEnvoi.get(i).setVisible(false);
				}
				ssgpLA.get(i).pack();
				groupEchantillon.pack();
				composite_1.pack();
			}
		});

		raisonEnvoi.add(i, new Label(ssgpLA.get(i), SWT.NONE));
		raisonEnvoi.get(i).setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
		raisonEnvoi.get(i).setFont(boldFont);
		raisonEnvoi.get(i).setText("Pourquoi, à qui, quand :");
		tCommentaireEnvoi.add(i, new Text(ssgpLA.get(i), SWT.BORDER));
		GridData gridData_tCommentaireEnvoi = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
		gridData_tCommentaireEnvoi.heightHint = 150;
		tCommentaireEnvoi.get(i).setLayoutData(gridData_tCommentaireEnvoi);

		raisonEnvoi.get(i).setVisible(false);
		tCommentaireEnvoi.get(i).setVisible(false);

		if (DroitServiceImpl.getInstance().peutSupprimerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champLA")) {
			bSupLA.add(i, new Button(ssgpLA.get(i), SWT.NONE));
			bSupLA.get(i).setText("Supprimer le tube");
			bSupLA.get(i).setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
			bSupLA.get(i).addSelectionListener(new SelectionListener() {

				@Override
				public void widgetSelected(SelectionEvent e) {
					nbLA--;
					ssgpLA.get(i).dispose();
					gpLA.pack();
					gpLA.getParent().pack();
					gpLA.getParent().getParent().pack();
				}

				@Override
				public void widgetDefaultSelected(SelectionEvent e) {
					// TODO Auto-generated method stub

				}
			});
			bSupLA.get(i).setEnabled(false);
		}

		ssgpLA.get(i).setVisible(true);
		((GridData) ssgpLA.get(i).getLayoutData()).exclude = false;

		gpLA.setVisible(true);
		((GridData) gpLA.getLayoutData()).exclude = false;
		composite_1.pack();
		sc1.redraw();
	}

	private void createPrenatal() {
		/**
		 * le groupe du prénatal
		 */
		if (groupPrenatal == null) {
			groupPrenatal = new Group(composite_1, SWT.NONE);
			groupPrenatal.setText("Pr\u00E9natal");
			groupPrenatal.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
			groupPrenatal.setLayout(new GridLayout(4, false));

			Label lblPreleveur = new Label(groupPrenatal, SWT.NONE);
			lblPreleveur.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
			lblPreleveur.setText("Ponctionneur :");

			ArrayList<Utilisateur> listPrescipteurs = UtilisateurServiceImpl.getInstance().getPrescripteurs();
			comboPonctionneur = new ComboViewer(groupPrenatal, SWT.DROP_DOWN | SWT.READ_ONLY);
			comboPonctionneur.getCombo().setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 3, 1));
			comboPonctionneur.setContentProvider(ArrayContentProvider.getInstance());
			comboPonctionneur.setLabelProvider(new UtilisateurLabelProvider());
			// fill the list with ComboValue objects
			comboPonctionneur.setInput(listPrescipteurs);
			comboPonctionneur.addSelectionChangedListener(selectionChangedComboPresc);

			Label lblDateDeDbut = new Label(groupPrenatal, SWT.NONE);
			lblDateDeDbut.setFont(boldFont);
			lblDateDeDbut.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblDateDeDbut.setText("Date de d\u00E9but de grossesse :");

			dateDG = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_dateDG = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
			gridData_dateDG.widthHint = 75;
			dateDG.getControl().setLayoutData(gridData_dateDG);
			dateDG.setFormatter(new DateFormatter("dd/MM/yyyy"));
			dateDG.getControl().addFocusListener(new FocusListener() {

				@Override
				public void focusLost(FocusEvent e) {
					if (datePrelev.getValue() != null && dateDG.getValue() != null) {
						Date dPrel = (Date) datePrelev.getValue();
						Date ddg = (Date) dateDG.getValue();
						if (dPrel != null && ddg != null) {
							double age = (dPrel.getTime() - (ddg.getTime() - (14 * 24 * 60 * 60 * 1000))) / (7 * 24 * 60 * 60 * 1000);
							tTerme.setValue(age + 1);
						}
					}
				}

				@Override
				public void focusGained(FocusEvent e) {
					// TODO Auto-generated method stub

				}
			});

			Label lblTermeActuel = new Label(groupPrenatal, SWT.NONE);
			lblTermeActuel.setFont(boldFont);
			lblTermeActuel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblTermeActuel.setText("Terme au moment de prélèvement (SA):");

			tTerme = new FormattedText(groupPrenatal, SWT.BORDER);
			tTerme.setFormatter(new NumberFormatter(ApplicationContexte.nfEntier, Locale.FRENCH));
			GridData gridData_tTerme = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
			gridData_tTerme.widthHint = 30;
			tTerme.getControl().setLayoutData(gridData_tTerme);

			Label lblDateNaissanceMere = new Label(groupPrenatal, SWT.NONE);
			lblDateNaissanceMere.setFont(boldFont);
			lblDateNaissanceMere.setText("Date de naissance de la m\u00E8re :");

			dateNaissanceMere = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_dateNaissanceMere = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
			gridData_dateNaissanceMere.widthHint = 75;
			dateNaissanceMere.getControl().setLayoutData(gridData_dateNaissanceMere);
			dateNaissanceMere.setFormatter(new DateFormatter("dd/MM/yyyy"));
			if (prelevement != null) {
				Personne p = PersonneServiceImpl.getInstance().getPersonneById(prelevement.getPersonne().getIdPersonne());
				if (p != null) {
					dateNaissanceMere.setValue(p.getDateNaissance());
				}
			}
			dateNaissanceMere.getControl().addFocusListener(new FocusListener() {

				@Override
				public void focusLost(FocusEvent e) {
					if (datePrelev.getValue() != null && dateNaissanceMere.getValue() != null) {
						Date dPrel = (Date) datePrelev.getValue();
						Date dNMere = (Date) dateNaissanceMere.getValue();
						if (dPrel != null && dNMere != null) {
							double age = (dPrel.getTime() - dNMere.getTime()) / (365.25 * 24 * 60 * 60 * 1000);
							DecimalFormat df = new DecimalFormat("##");
							df.setRoundingMode(RoundingMode.DOWN);
							tAgeMat.setValue(Integer.parseInt(df.format(age)));
						}
					}
				}

				@Override
				public void focusGained(FocusEvent e) {
					if (dateNaissanceMere.getValue() == null) {
						if (prelevement != null) {
							Personne p = PersonneServiceImpl.getInstance().getPersonneById(prelevement.getPersonne().getIdPersonne());
							if (p != null) {
								dateNaissanceMere.setValue(p.getDateNaissance());
							}
						}
					}

				}
			});

			Label lblAgeMaternel = new Label(groupPrenatal, SWT.NONE);
			lblAgeMaternel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblAgeMaternel.setFont(boldFont);
			lblAgeMaternel.setText("Age maternel (au moment du prélèvement):");

			tAgeMat = new FormattedText(groupPrenatal, SWT.BORDER);
			tAgeMat.setFormatter(new NumberFormatter(ApplicationContexte.nfEntier, Locale.FRENCH));
			GridData gridData_tAgeMat = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tAgeMat.widthHint = 30;
			tAgeMat.getControl().setLayoutData(gridData_tAgeMat);

			if (datePrelev.getValue() != null && dateNaissanceMere.getValue() != null) {
				Date dPrel = (Date) datePrelev.getValue();
				Date dNMere = (Date) dateNaissanceMere.getValue();
				if (dPrel != null && dNMere != null) {
					double age = (dPrel.getTime() - dNMere.getTime()) / (365.25 * 24 * 60 * 60 * 1000);
					DecimalFormat df = new DecimalFormat("##");
					df.setRoundingMode(RoundingMode.DOWN);
					tAgeMat.setValue(Integer.parseInt(df.format(age)));
				}
			}

			Group group1 = new Group(groupPrenatal, SWT.SHADOW_IN);
			group1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 4, 1));
			group1.setText("Sexe du foetus* :");
			group1.setLayout(new RowLayout(SWT.VERTICAL));

			btnRadioSexefF = new Button(group1, SWT.RADIO);
			btnRadioSexefF.setText("F");
			btnRadioSexefM = new Button(group1, SWT.RADIO);
			btnRadioSexefM.setText("M");
			btnRadioSexefNA = new Button(group1, SWT.RADIO);
			btnRadioSexefNA.setText("non connu");
			btnRadioSexefNA.setSelection(true);
			btnRadioSexefNA.setToolTipText("Le sexe n'est pas préciser dans le dossier");

			btnRadioSexefI = new Button(group1, SWT.RADIO);
			btnRadioSexefI.setText("Indeterminé");
			btnRadioSexefI.setToolTipText("Il n'est pas possible de déterminer si c'est un garçon ou une fille");

			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);

			Label lblClartNucale = new Label(groupPrenatal, SWT.NONE);
			lblClartNucale.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblClartNucale.setText("Clart\u00E9 nucale 1er trim : ");

			tNuquePrem = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tNuquePrem = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tNuquePrem.widthHint = 50;
			tNuquePrem.getControl().setLayoutData(gridData_tNuquePrem);
			tNuquePrem.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblLcc = new Label(groupPrenatal, SWT.NONE);
			lblLcc.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblLcc.setText("LCC 1er trim :");

			tLCCPrem = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tLCCPrem = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tLCCPrem.widthHint = 50;
			tLCCPrem.getControl().setLayoutData(gridData_tLCCPrem);
			tLCCPrem.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblPappa = new Label(groupPrenatal, SWT.NONE);
			lblPappa.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblPappa.setText("PAPP-A :");

			tPAPPAPrem = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tPAPPAPrem = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tPAPPAPrem.widthHint = 50;
			tPAPPAPrem.getControl().setLayoutData(gridData_tPAPPAPrem);
			tPAPPAPrem.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblhcgLibre = new Label(groupPrenatal, SWT.NONE);
			lblhcgLibre.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblhcgLibre.setText("\u03B2hcG libre 1er trim :");

			tBetaPrem = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tBetaPrem = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tBetaPrem.widthHint = 50;
			tBetaPrem.getControl().setLayoutData(gridData_tBetaPrem);
			tBetaPrem.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblTestCombinDu = new Label(groupPrenatal, SWT.NONE);
			lblTestCombinDu.setFont(boldFont);
			lblTestCombinDu.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblTestCombinDu.setText("Test combin\u00E9 du 1er trim 1/");

			tCombine = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tCombine = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tCombine.widthHint = 50;
			tCombine.getControl().setLayoutData(gridData_tCombine);
			tCombine.setFormatter(new NumberFormatter(ApplicationContexte.nfEntier, Locale.US));

			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);

			Label lblMarqueursSriquesDu = new Label(groupPrenatal, SWT.NONE);
			lblMarqueursSriquesDu.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblMarqueursSriquesDu.setText("Marqueurs s\u00E9riques du 2\u00E8me trim");

			tMqSerique = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tMqSerique = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tMqSerique.widthHint = 50;
			tMqSerique.getControl().setLayoutData(gridData_tMqSerique);
			tMqSerique.setFormatter(new NumberFormatter(ApplicationContexte.nfEntier, Locale.US));

			Label lblhcgLibreme = new Label(groupPrenatal, SWT.NONE);
			lblhcgLibreme.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblhcgLibreme.setText("\u03B2hcG libre 2\u00E8me trim :");

			tBetaSecond = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tBetaSecond = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tBetaSecond.widthHint = 50;
			tBetaSecond.getControl().setLayoutData(gridData_tBetaSecond);
			tBetaSecond.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));

			Label lblfp = new Label(groupPrenatal, SWT.NONE);
			lblfp.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblfp.setText("\u03B1-FP :");

			tAlphaSecond = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tAlphaSecond = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tAlphaSecond.widthHint = 50;
			tAlphaSecond.getControl().setLayoutData(gridData_tAlphaSecond);
			tAlphaSecond.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);

			Label lblTestSquentielIntgr = new Label(groupPrenatal, SWT.NONE);
			lblTestSquentielIntgr.setFont(boldFont);
			lblTestSquentielIntgr.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblTestSquentielIntgr.setText("Test s\u00E9quentiel int\u00E9gr\u00E9 1/");

			tSequentielIntegre = new FormattedText(groupPrenatal, SWT.BORDER);
			GridData gridData_tSequentielIntegre = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
			gridData_tSequentielIntegre.widthHint = 50;
			tSequentielIntegre.getControl().setLayoutData(gridData_tSequentielIntegre);
			tSequentielIntegre.setFormatter(new NumberFormatter(ApplicationContexte.nf2AV, Locale.US));
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);

			Label lblSignesDappels = new Label(groupPrenatal, SWT.NONE);
			lblSignesDappels.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
			lblSignesDappels.setText("Signes d'appel \u00E9chographique");
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);
			new Label(groupPrenatal, SWT.NONE);

			tSigneAppel = new Text(groupPrenatal, SWT.BORDER);
			GridData gridData_tSigneAppel = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
			gridData_tSigneAppel.widthHint = 150;
			gridData_tSigneAppel.heightHint = 50;
			tSigneAppel.setLayoutData(gridData_tSigneAppel);
			// setModifiable(isModifiable);
		}

		groupPrenatal.setVisible(true);
		((GridData) groupPrenatal.getLayoutData()).exclude = false;
		composite_1.pack();
		sc1.redraw();
	}

	public Prelevement getPrelevement() {
		return prelevement;
	}

	public TabItem getTabItem() {
		return prelevementTabItem;
	}

	public boolean isModifiable() {
		return isModifiable;
	}

	public Prelevement recupererObjet() {
		if (verifierChamp()) {
			prelevement.setNumeroPrelevement(tNumeroPrelevement.getText());
			if (tNSejour != null) {
				prelevement.setNumSejour(tNSejour.getControl().getText().trim());
			}
			if (tInfoIndication != null) {
				prelevement.setInfoIndication(tInfoIndication.getText());
			}
			if (btnRadioPrenatal.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioPrenatal.getText()));
			} else if (btnRadioPostnatal.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioPostnatal.getText()));
			} else if (btnRadioPucesPre.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioPucesPre.getText()));
			} else if (btnRadioPucesPost.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioPucesPost.getText()));
			} else if (btnRadioBanques.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioBanques.getText()));
			} else if (btnRadioCellules.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioCellules.getText()));
			} else if (btnRadioFoeto.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioFoeto.getText()));
			} else if (btnRadioPucesFoeto.getSelection()) {
				prelevement.setSecteur(ReferentielServiceImpl.getInstance().getSecteurByNom(btnRadioPucesFoeto.getText()));
			}
			prelevement.setRecherche(btnCheckRecherche.getSelection());
			prelevement.setDpi(btnCheckDpi.getSelection());
			ISelection selectionDerive = comboDerive.getSelection();
			if (!selectionDerive.isEmpty()) {
				IStructuredSelection selection = (IStructuredSelection) selectionDerive;
				Prelevement numeroDerive = (Prelevement) selection.getFirstElement();
				if (numeroDerive.getIdPrelevement() != 0) {
					prelevement.setDerive(numeroDerive);
				}
			}
			ISelection selectionEchantillon = comboTypeEchantillon.getSelection();
			if (!selectionEchantillon.isEmpty()) {
				IStructuredSelection structuredSelection = (IStructuredSelection) selectionEchantillon;
				prelevement.setTypePrelevement((TypePrelevement) structuredSelection.getFirstElement());
			}
			ISelection selectionTypeIndic = comboTypeIndication.getSelection();
			if (!selectionTypeIndic.isEmpty()) {
				IStructuredSelection structuredSelection = (IStructuredSelection) selectionTypeIndic;
				prelevement.setIndication((Biomedecine) structuredSelection.getFirstElement());
			}

			ISelection selectionMedecin = comboPrescripteur.getSelection();
			if (!selectionMedecin.isEmpty()) {
				IStructuredSelection structuredSelection = (IStructuredSelection) selectionMedecin;
				Utilisateur medecin = (Utilisateur) structuredSelection.getFirstElement();
				if (medecin.getIdUtilisateur() != null) {
					prelevement.setPrescripteur(medecin);
				} else {
					prelevement.setPrescripteur(null);
				}
			}

			ISelection selectionMedecin2 = comboPrescripteur2.getSelection();
			if (!selectionMedecin2.isEmpty()) {
				IStructuredSelection structuredSelection = (IStructuredSelection) selectionMedecin2;
				Utilisateur medecin2 = (Utilisateur) structuredSelection.getFirstElement();
				if (medecin2.getIdUtilisateur() != null) {
					prelevement.setPrescripteur2(medecin2);
				} else {
					prelevement.setPrescripteur2(null);
				}
			}

			ISelection selectionMedecin3 = comboPrescripteur3.getSelection();
			if (!selectionMedecin3.isEmpty()) {
				IStructuredSelection structuredSelection = (IStructuredSelection) selectionMedecin3;
				Utilisateur medecin3 = (Utilisateur) structuredSelection.getFirstElement();
				if (medecin3.getIdUtilisateur() != null) {
					prelevement.setPrescripteur3(medecin3);
				} else {
					prelevement.setPrescripteur3(null);
				}
			}

			if (tNomPrenomAutrePresc.getText().trim() != null) {
				prelevement.setNomPrenomAutrePresc(tNomPrenomAutrePresc.getText().trim());
			}
			if (!tUFPrescr.getText().isEmpty()) {
				prelevement.setUfPresc(Integer.parseInt(tUFPrescr.getText()));
			}
			prelevement.setDatePrelevement((Date) datePrelev.getValue());
			prelevement.setDateReception((Date) dateReception.getValue());

			prelevement.setChamps(new ArrayList<Champ>());
			// prenatal
			if (btnRadioPrenatal.getSelection() || btnRadioPucesPre.getSelection()) {
				// String ddg = dateDG.getYear() + "-" + dateDG.getMonth() + 1 +
				// "-" + dateDG.getDay();

				if (dateDG.getValue() != null) {
					DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
					Date champDDG = (Date) dateDG.getValue();
					prelevement.addChamp(new Champ(formatUS.format(champDDG), "dateDG", "Prel-" + prelevement.getIdPrelevement()));
				}
				if (dateNaissanceMere.getValue() != null) {
					DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
					Date champDNM = (Date) dateNaissanceMere.getValue();
					prelevement.addChamp(new Champ(formatUS.format(champDNM), "dateNaissanceMere", "Prel-" + prelevement.getIdPrelevement()));
				}

				ISelection selectionPonc = comboPonctionneur.getSelection();
				if (!selectionPonc.isEmpty()) {
					IStructuredSelection structuredSelection = (IStructuredSelection) selectionPonc;
					Utilisateur ponc = (Utilisateur) structuredSelection.getFirstElement();
					prelevement.addChamp(new Champ(ponc.getIdUtilisateur() + "", "comboPonctionneur", "Prel-" + prelevement.getIdPrelevement()));
				}

				String sexeFeotus = "NA";
				if (btnRadioSexefF.getSelection()) {
					sexeFeotus = "F";
				}
				if (btnRadioSexefM.getSelection()) {
					sexeFeotus = "M";
				}
				if (btnRadioSexefNA.getSelection()) {
					sexeFeotus = "NA";
				}
				if (btnRadioSexefI.getSelection()) {
					sexeFeotus = "I";
				}

				prelevement.addChamp(new Champ("" + sexeFeotus, "tSexeFoetus", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tAgeMat.getValue(), "tAgeMat", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tAlphaSecond.getValue(), "tAlphaSecond", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tBetaPrem.getValue(), "tBetaPrem", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tBetaSecond.getValue(), "tBetaSecond", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tMqSerique.getValue(), "tMqSerique", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tLCCPrem.getValue(), "tLCCPrem", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tCombine.getValue(), "tCombine", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tNuquePrem.getValue(), "tNuquePrem", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tPAPPAPrem.getValue(), "tPAPPAPrem", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tSequentielIntegre.getValue(), "tSequentielIntegre", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tSigneAppel.getText(), "tSigneAppel", "Prel-" + prelevement.getIdPrelevement()));
				prelevement.addChamp(new Champ("" + tTerme.getValue(), "tTerme", "Prel-" + prelevement.getIdPrelevement()));
			}

			TypePrelevement typePrelevementSel = null;
			ISelection selectionTypeEchant = comboTypeEchantillon.getSelection();
			if (!selectionTypeEchant.isEmpty()) {
				IStructuredSelection structuredSelection = (IStructuredSelection) selectionTypeEchant;
				typePrelevementSel = (TypePrelevement) structuredSelection.getFirstElement();
			}
			if (typePrelevementSel != null) {
				int typeP = typePrelevementSel.getIdTypePrelevement();
				// //LA
				if (typeP == 13) {
					// LA
					prelevement.addChamp(new Champ("" + nbLA, "nbLA", "Prel-" + prelevement.getIdPrelevement()));
					int j = 0;
					for (int i = 0; i < ssgpLA.size(); i++) {
						if (ssgpLA.get(i) != null && !ssgpLA.get(i).isDisposed()) {

							if (comboAspectCulotLA.get(i).getSelectionIndex() != -1) {
								String aspectCulotLA = comboAspectCulotLA.get(i).getItem(comboAspectCulotLA.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(aspectCulotLA, "comboAspectCulotLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								if (aspectCulotLA.equals("autre")) {
									prelevement.addChamp(new Champ(tASpecifierAspectCulotLA.get(i).getText(), "tASpecifierAspectCulotLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								}
							}
							if (comboAspectLA.get(i).getSelectionIndex() != -1) {
								String aspectLA = comboAspectLA.get(i).getItem(comboAspectLA.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(aspectLA, "comboAspectLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								if (aspectLA.equals("autre")) {
									prelevement.addChamp(new Champ(tASpecifierAspectLA.get(i).getText(), "tASpecifierAspectLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								}
							}
							if (comboVolCulotLA.get(i).getSelectionIndex() != -1) {
								String volCulotLA = comboVolCulotLA.get(i).getItem(comboVolCulotLA.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(volCulotLA, "comboVolCulotLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							}
							if (comboVolLA.get(i).getSelectionIndex() != -1) {
								String volLA = comboVolLA.get(i).getItem(comboVolLA.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(volLA, "comboVolLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								if (volLA.equals(">20 mL")) {
									prelevement.addChamp(new Champ(tASpecifierVolLA.get(i).getText(), "tASpecifierVolLA" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								}
							}
							prelevement.addChamp(new Champ((((Boolean) btnCheckEnvoye.get(i).getSelection()).toString()), "btnCheckEnvoye" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							if (btnCheckEnvoye.get(i).getSelection()) {
								prelevement.addChamp(new Champ(tCommentaireEnvoi.get(i).getText(), "tCommentaireEnvoi" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							}

							j++;
						}

					}
					if (btnCheckGarderCultureLA != null) {
						prelevement.addChamp(new Champ((((Boolean) btnCheckGarderCultureLA.getSelection()).toString()), "btnCheckGarderCultureLA", "Prel-" + prelevement.getIdPrelevement()));
					}
					if (dateMiseEnCultureLA != null && dateMiseEnCultureLA.getValue() != null) {
						DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
						Date champMiseEnCultureLA = (Date) dateMiseEnCultureLA.getValue();
						prelevement.addChamp(new Champ(formatUS.format(champMiseEnCultureLA), "dateCultLA", "Prel-" + prelevement.getIdPrelevement()));
					}
				}

				// //VC
				else if (typeP == 4) {
					// VC
					prelevement.addChamp(new Champ((((Boolean) btnCheckGarderCultureVC.getSelection()).toString()), "btnCheckGarderCultureVC", "Prel-" + prelevement.getIdPrelevement()));
					String aspectMacroVC = "";
					for (Button baspectMacro : comboAspectMacroVC) {
						if (baspectMacro.getSelection()) {
							aspectMacroVC += baspectMacro.getText() + "-";
						}
					}
					if (!aspectMacroVC.isEmpty()) {
						prelevement.addChamp(new Champ(aspectMacroVC, "comboAspectMacroVC", "Prel-" + prelevement.getIdPrelevement()));
					}

					if (tASpecifierAspectMacroVC != null && tASpecifierAspectMacroVC.getText() != null && !tASpecifierAspectMacroVC.getText().isEmpty()) {
						prelevement.addChamp(new Champ(tASpecifierAspectMacroVC.getText(), "tASpecifierAspectMacroVC", "Prel-" + prelevement.getIdPrelevement()));
					}

					String aspectMicroVC = "";
					for (Button baspectMicro : comboAspectMicroVC) {
						if (baspectMicro.getSelection()) {
							aspectMicroVC += baspectMicro.getText() + "-";
						}
					}
					if (!aspectMicroVC.isEmpty()) {
						prelevement.addChamp(new Champ(aspectMicroVC, "comboAspectMicroVC", "Prel-" + prelevement.getIdPrelevement()));
					}
					if (tASpecifierAspectMicroVC != null && tASpecifierAspectMicroVC.getText() != null && !tASpecifierAspectMicroVC.getText().isEmpty()) {
						prelevement.addChamp(new Champ(tASpecifierAspectMicroVC.getText(), "tASpecifierAspectMicroVC", "Prel-" + prelevement.getIdPrelevement()));
					}
					if (comboVolVC.getSelectionIndex() != -1) {
						String volVC = comboVolVC.getItem(comboVolVC.getSelectionIndex());
						prelevement.addChamp(new Champ(volVC, "comboVolVC", "Prel-" + prelevement.getIdPrelevement()));
					}
					if (dateMiseEnCultureVC.getValue() != null) {
						DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
						Date champMiseEnCultureVC = (Date) dateMiseEnCultureVC.getValue();
						prelevement.addChamp(new Champ(formatUS.format(champMiseEnCultureVC), "dateCultVC", "Prel-" + prelevement.getIdPrelevement()));
					}

				}// //Fibroblastes
				else if (typeP == 5) {
					// Fibro
					if (comboAspectFibro.getSelectionIndex() != -1) {
						String aspectFibro = comboAspectFibro.getItem(comboAspectFibro.getSelectionIndex());
						prelevement.addChamp(new Champ(aspectFibro, "comboAspectFibro", "Prel-" + prelevement.getIdPrelevement()));
					}
					if (comboVolFibro.getSelectionIndex() != -1) {
						String volFibro = comboVolFibro.getItem(comboVolFibro.getSelectionIndex());
						prelevement.addChamp(new Champ(volFibro, "comboVolFibro", "Prel-" + prelevement.getIdPrelevement()));
					}
					if (dateMiseEnCultureF.getValue() != null) {
						DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
						Date champMiseEnCultureF = (Date) dateMiseEnCultureF.getValue();
						prelevement.addChamp(new Champ(formatUS.format(champMiseEnCultureF), "dateCultF", "Prel-" + prelevement.getIdPrelevement()));
					}
				} // //SANG + foetal
				else if (typeP == 1 || typeP == 2) {
					// SANG
					prelevement.addChamp(new Champ("" + nbSang, "nbSang", "Prel-" + prelevement.getIdPrelevement()));
					int j = 0;
					for (int i = 0; i < ssgpS.size(); i++) {
						if (ssgpS.get(i) != null && !ssgpS.get(i).isDisposed()) {

							if (comboAspectSang.get(i).getSelectionIndex() != -1) {
								String aspectSang = comboAspectSang.get(i).getItem(comboAspectSang.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(aspectSang, "comboAspectSang" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							}
							if (comboTube.get(i).getSelectionIndex() != -1) {
								String tube = comboTube.get(i).getItem(comboTube.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(tube, "comboTube" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								if (tube.equals("autre")) {
									prelevement.addChamp(new Champ(tASpecifierTube.get(i).getText(), "tASpecifierTube" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
								}
							}

							if (comboVolSang.get(i).getSelectionIndex() != -1) {
								String volSang = comboVolSang.get(i).getItem(comboVolSang.get(i).getSelectionIndex());
								prelevement.addChamp(new Champ(volSang, "comboVolSang" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							}

							prelevement.addChamp(new Champ(tRangementSang.get(i).getText(), "tRangementSang" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));

							prelevement.addChamp(new Champ((((Boolean) btnCheckEnvoye.get(i).getSelection()).toString()), "btnCheckEnvoye" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							if (btnCheckEnvoye.get(i).getSelection()) {
								prelevement.addChamp(new Champ(tCommentaireEnvoi.get(i).getText(), "tCommentaireEnvoi" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							}
							if (dateMiseEnCultureS.get(i).getValue() != null) {
								DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
								Date champMiseEnCultureS = (Date) dateMiseEnCultureS.get(i).getValue();
								prelevement.addChamp(new Champ(formatUS.format(champMiseEnCultureS), "dateCultS" + "-" + j, "Prel-" + prelevement.getIdPrelevement()));
							}
							j++;
						}
					}
				} // //ADN
				if (typeP == 11 || prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_FOETO) || prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_POSTNATAL)
						|| prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_PRENATAL)) {
					// ADN
					prelevement.addChamp(new Champ("" + t260_230.getValue(), "t260_230", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + t260_280.getValue(), "t260_280", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tAE.getValue(), "tAE", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tConcentrationADN.getValue(), "tConcentrationADN", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tRangementADN.getText(), "tRangementADN", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tVolADN.getValue(), "tVolADN", "Prel-" + prelevement.getIdPrelevement()));
					if (dateExtraction.getValue() != null) {
						DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
						Date dExt = (Date) dateExtraction.getValue();
						prelevement.addChamp(new Champ(formatUS.format(dExt), "dateExtraction", "Prel-" + prelevement.getIdPrelevement()));
					}

					prelevement.addChamp(new Champ("" + t260_230purif.getValue(), "t260_230purif", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + t260_280purif.getValue(), "t260_280purif", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tAEpurif.getValue(), "tAEpurif", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tConcentrationADNpurif.getValue(), "tConcentrationADNpurif", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tRangementADNpurif.getText(), "tRangementADNpurif", "Prel-" + prelevement.getIdPrelevement()));
					prelevement.addChamp(new Champ("" + tVolADNpurif.getValue(), "tVolADNpurif", "Prel-" + prelevement.getIdPrelevement()));
					if (datePurification.getValue() != null) {
						DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
						Date dExt = (Date) datePurification.getValue();
						prelevement.addChamp(new Champ(formatUS.format(dExt), "datePurification", "Prel-" + prelevement.getIdPrelevement()));
					}

					if (btnCheckExtraction.getSelection() && btnCheckPurification.getSelection()) {
						prelevement.addChamp(new Champ("Extraction et Purification", "tTypeADN", "Prel-" + prelevement.getIdPrelevement()));
					} else if (btnCheckPurification.getSelection() && !btnCheckExtraction.getSelection()) {
						prelevement.addChamp(new Champ("Purification", "tTypeADN", "Prel-" + prelevement.getIdPrelevement()));
					} else if (!btnCheckPurification.getSelection() && btnCheckExtraction.getSelection()) {
						prelevement.addChamp(new Champ("Extraction", "tTypeADN", "Prel-" + prelevement.getIdPrelevement()));
					}

					prelevement.addChamp(new Champ("" + nbEnvoiADN, "nbEnvoiADN", "Prel-" + prelevement.getIdPrelevement()));

					for (int i = 0; i < Math.max(tVolEnvoye.size(), nbEnvoiADN); i++) {
						if (tVolEnvoye.get(i) != null && tVolEnvoye.get(i).getValue() != null) {
							prelevement.addChamp(new Champ("" + tVolEnvoye.get(i).getValue(), "tVolEnvoye" + "-" + i, "Prel-" + prelevement.getIdPrelevement()));
						}
						if (dateEnvoi.get(i) != null && dateEnvoi.get(i).getValue() != null) {
							DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
							Date champEnvoi = (Date) dateEnvoi.get(i).getValue();
							prelevement.addChamp(new Champ(formatUS.format(champEnvoi), "dateEnvoi" + "-" + i, "Prel-" + prelevement.getIdPrelevement()));
						}
						if (dateDemande.get(i) != null && dateDemande.get(i).getValue() != null) {
							DateFormat formatUS = new SimpleDateFormat("yyyy-MM-dd");
							Date dDemande = (Date) dateDemande.get(i).getValue();
							prelevement.addChamp(new Champ(formatUS.format(dDemande), "dateDemande" + "-" + i, "Prel-" + prelevement.getIdPrelevement()));
						}
						// if (tVolEnvoye.get(i) != null &&
						// tVolEnvoye.get(i).getValue() != null) {
						// prelevement.addChamp(new Champ("" +
						// tVolEnvoye.get(i).getValue(), "tVolEnvoye" + "-" + i,
						// "Prel-" + prelevement.getIdPrelevement()));
						// }
						if (comboDemandeur.get(i) != null) {
							ISelection selectionDemandeur = comboDemandeur.get(i).getSelection();
							if (!selectionDemandeur.isEmpty()) {
								IStructuredSelection structuredSelection = (IStructuredSelection) selectionDemandeur;
								Utilisateur demandeur = (Utilisateur) structuredSelection.getFirstElement();
								if (demandeur.getIdUtilisateur() != null) {
									prelevement.addChamp(new Champ("" + demandeur.getIdUtilisateur(), "comboDemandeur" + "-" + i, "Prel-" + prelevement.getIdPrelevement()));
								}
							}

						}
					}

				}
			}

		} else {
			return null;
		}
		return prelevement;
	}

	public void remplir(final Prelevement prelevement) {
		removeDirtyListener();
		this.prelevement = prelevement;
		// prélèvement
		tNSejour.getControl().setText("");
		tNumeroPrelevement.setText("");
		tInfoIndication.setText("");
		btnRadioBanques.setSelection(false);
		btnRadioCellules.setSelection(false);
		btnRadioPostnatal.setSelection(false);
		btnRadioPrenatal.setSelection(false);
		btnRadioPucesPost.setSelection(false);
		btnRadioPucesFoeto.setSelection(false);
		btnRadioFoeto.setSelection(false);
		btnRadioPucesPre.setSelection(false);
		btnCheckRecherche.setSelection(false);
		btnCheckDpi.setSelection(false);
		// comboDerive.getCombo().setSelection(null);
		// comboTypeEchantillon.getCombo().setSelection(null);
		// comboTypeIndication.getCombo().setSelection(null);
		datePrelev.getControl().setData(null);
		dateReception.getControl().setData(null);

		comboDerive.getControl().setData(null);
		comboTypeEchantillon.getControl().setData(null);
		comboTypeIndication.getControl().setData(null);
		tNomPrenomAutrePresc.setText("");
		tUFPrescr.setText("");

		if (btnCheckGarderCultureVC != null) {
			btnCheckGarderCultureVC.setSelection(false);
		}
		if (comboAspectFibro != null) {
			comboAspectFibro.setText("");
		}

		for (Button cAspectMacroVC : comboAspectMacroVC) {
			if (cAspectMacroVC != null) {
				cAspectMacroVC.setSelection(false);
			}
		}

		for (Button cAspectMicroVC : comboAspectMicroVC) {
			if (cAspectMicroVC != null) {
				cAspectMicroVC.setSelection(false);
			}
		}

		if (comboVolFibro != null) {
			comboVolFibro.setText("");
		}
		if (comboVolVC != null) {
			comboVolVC.setText("");
		}
		if (dateDG != null) {
			dateDG.getControl().setText("");
		}
		if (comboPonctionneur != null) {
			comboPonctionneur.getCombo().setText("");
		}
		if (dateNaissanceMere != null) {
			dateNaissanceMere.getControl().setText("");
		}

		if (t260_230 != null) {
			t260_230.getControl().setText("");
		}
		if (t260_280 != null) {
			t260_280.getControl().setText("");
		}
		if (tAE != null) {
			tAE.getControl().setText("");
		}
		if (tConcentrationADN != null) {
			tConcentrationADN.getControl().setText("");
		}
		if (tRangementADN != null) {
			tRangementADN.setText("");
		}
		if (t260_230purif != null) {
			t260_230purif.getControl().setText("");
		}
		if (t260_280purif != null) {
			t260_280purif.getControl().setText("");
		}
		if (tAEpurif != null) {
			tAEpurif.getControl().setText("");
		}
		if (tRangementADNpurif != null) {
			tRangementADNpurif.setText("");
		}
		if (tConcentrationADNpurif != null) {
			tConcentrationADNpurif.getControl().setText("");
		}
		if (tVolADN != null) {
			tVolADN.getControl().setText("");
		}
		if (tVolADNpurif != null) {
			tVolADNpurif.getControl().setText("");
		}
		if (dateExtraction != null) {
			dateExtraction.getControl().setText("");
		}
		if (datePurification != null) {
			datePurification.getControl().setText("");
		}
		if (btnCheckPurification != null) {
			btnCheckPurification.setSelection(false);
		}
		if (btnCheckExtraction != null) {
			btnCheckExtraction.setSelection(false);
		}
		// if (btnRadioDilution != null) {
		// btnRadioDilution.setSelection(false);
		// }
		if (tAgeMat != null) {
			tAgeMat.getControl().setText("");
		}
		if (tAlphaSecond != null) {
			tAlphaSecond.getControl().setText("");
		}

		for (int i = 0; i < comboVolCulotLA.size(); i++) {

			if (comboAspectCulotLA.get(i) != null && !comboAspectCulotLA.get(i).isDisposed()) {
				comboAspectCulotLA.get(i).setText("");
			}
			if (comboVolLA.get(i) != null && !comboVolLA.get(i).isDisposed()) {
				comboVolLA.get(i).setText("");
			}
			if (comboVolCulotLA.get(i) != null && !comboVolCulotLA.get(i).isDisposed()) {
				comboVolCulotLA.get(i).setText("");
			}
			if (comboAspectLA.get(i) != null && !comboAspectLA.get(i).isDisposed()) {
				comboAspectLA.get(i).setText("");
			}
			if (tASpecifierAspectCulotLA.get(i) != null && !tASpecifierAspectCulotLA.get(i).isDisposed()) {
				tASpecifierAspectCulotLA.get(i).setText("");
			}
			if (tASpecifierAspectLA.get(i) != null && !tASpecifierAspectLA.get(i).isDisposed()) {
				tASpecifierAspectLA.get(i).setText("");
			}
			if (tASpecifierVolLA.get(i) != null && !tASpecifierVolLA.get(i).isDisposed()) {
				tASpecifierVolLA.get(i).setText("");
			}
			if (tCommentaireEnvoi.get(i) != null && !tCommentaireEnvoi.get(i).isDisposed()) {
				tCommentaireEnvoi.get(i).setText("");
			}

			if (btnCheckEnvoye.get(i) != null && !btnCheckEnvoye.get(i).isDisposed()) {
				btnCheckEnvoye.get(i).setSelection(false);
			}

		}
		if (btnCheckGarderCultureLA != null) {
			btnCheckGarderCultureLA.setSelection(false);
		}
		for (int i = 0; i < comboAspectSang.size(); i++) {
			if (comboAspectSang.get(i) != null && !comboAspectSang.get(i).isDisposed()) {
				comboAspectSang.get(i).setText("");
			}
			if (tASpecifierTube.get(i) != null && !tASpecifierTube.get(i).isDisposed()) {
				tASpecifierTube.get(i).setText("");
			}
			if (tRangementSang.get(i) != null && !tRangementSang.get(i).isDisposed()) {
				tRangementSang.get(i).setText("");
			}
			if (tASpecifierTube.get(i) != null && !tASpecifierTube.get(i).isDisposed()) {
				tASpecifierTube.get(i).setText("");
			}
			if (comboVolSang.get(i) != null && !comboVolSang.get(i).isDisposed()) {
				comboVolSang.get(i).setText("");
			}

			if (comboTube.get(i) != null && !comboTube.get(i).isDisposed()) {
				comboTube.get(i).setText("");
			}
			if (tCommentaireEnvoi.get(i) != null && !tCommentaireEnvoi.get(i).isDisposed()) {
				tCommentaireEnvoi.get(i).setText("");
			}

			if (btnCheckEnvoye.get(i) != null && !btnCheckEnvoye.get(i).isDisposed()) {
				btnCheckEnvoye.get(i).setSelection(false);
			}

		}

		if (gpEnvoiADN == null) {
			gpEnvoiADN = new Group(gpAD, SWT.NONE);
			gpEnvoiADN.setLayout(new GridLayout(4, false));
			gpEnvoiADN.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

		}

		if (tVolEnvoye != null) {
			for (int i = 0; i < tVolEnvoye.size(); i++) {
				if (tVolEnvoye.get(i) != null && !tVolEnvoye.get(i).getControl().isDisposed()) {
					tVolEnvoye.get(i).getControl().setText("");
					dateEnvoi.get(i).getControl().setText("");
					dateDemande.get(i).getControl().setText("");
					comboDemandeur.get(i).getCombo().setText("");
				}
			}
		}

		if (tBetaPrem != null) {
			tBetaPrem.getControl().setText("");
		}
		if (tBetaSecond != null) {
			tBetaSecond.getControl().setText("");
		}
		if (tCombine != null) {
			tCombine.getControl().setText("");
		}

		if (tLCCPrem != null) {
			tLCCPrem.getControl().setText("");
		}
		if (tMqSerique != null) {
			tMqSerique.getControl().setText("");
		}
		if (tNuquePrem != null) {
			tNuquePrem.getControl().setText("");
		}
		if (tPAPPAPrem != null) {
			tPAPPAPrem.getControl().setText("");
		}

		if (tSequentielIntegre != null) {
			tSequentielIntegre.getControl().setText("");
		}
		if (tSigneAppel != null) {
			tSigneAppel.setText("");
		}
		if (tTerme != null) {
			tTerme.getControl().setText("");
		}

		if (tASpecifierAspectMacroVC != null) {
			tASpecifierAspectMacroVC.setText("");
		}
		if (tASpecifierAspectMicroVC != null) {
			tASpecifierAspectMicroVC.setText("");
		}

		// prenatal
		if (dateDG != null) {
			btnRadioSexefF.setSelection(false);
			btnRadioSexefM.setSelection(false);
			btnRadioSexefNA.setSelection(true);
			btnRadioSexefI.setSelection(false);
			dateDG.getControl().setText("");
			comboPonctionneur.getCombo().setText("");
			dateNaissanceMere.getControl().setText("");
			tAgeMat.getControl().setText("");
			tAlphaSecond.getControl().setText("");
			tBetaPrem.getControl().setText("");
			tBetaSecond.getControl().setText("");
			tMqSerique.getControl().setText("");
			tLCCPrem.getControl().setText("");
			tCombine.getControl().setText("");
			tNuquePrem.getControl().setText("");
			tPAPPAPrem.getControl().setText("");
			tSequentielIntegre.getControl().setText("");
			tSigneAppel.setText("");
			tTerme.getControl().setText("");
		}

		// // LA
		// for (int i = 0; i < nbLA; i++) {
		// if (btnCheckGarderCultureLA != null && btnCheckGarderCultureLA.get(i)
		// !=
		// null) {
		// btnCheckGarderCultureLA.get(i).setSelection(false);
		// // comboAspectCulotLA.get(i).setSelection(null);
		// // comboAspectLA.get(i).setSelection(null);
		// // comboVolCulotLA.get(i).setSelection(null);
		// // comboVolLA.get(i).setSelection(null);
		// tASpecifierAspectCulotLA.get(i).setText("");
		// tASpecifierAspectLA.get(i).setText("");
		// tASpecifierVolLA.get(i).setText("");
		// }
		// }
		//
		// // VC
		// if (btnCheckGarderCultureVC != null) {
		// btnCheckGarderCultureVC.setSelection(false);
		// // comboAspectMacroVC.setSelection(null);
		// // comboAspectMicroVC.setSelection(null);
		// // comboVolVC.setSelection(null);
		// tASpecifierAspectMacroVC.setText("");
		// tASpecifierAspectMicroVC.setText("");
		// }
		//
		// // Fibro
		// // comboAspectFibro.setSelection(null);
		// // comboVolFibro.setSelection(null);
		//
		// // SANG
		// for (int i = 0; i < nbSang; i++) {
		// if (tCommentaireEnvoi != null && tCommentaireEnvoi.get(i) != null) {
		// // comboAspectSang.get(i).setSelection(null);
		// // comboTube.get(i).setSelection(null);
		// // comboVolSang.get(i).setSelection(null);
		// tCommentaireEnvoi.get(i).setText("");
		// tASpecifierTube.get(i).setText("");
		// btnCheckEnvoye.get(i).setSelection(false);
		// }
		// }
		//
		// // ADN
		// if (t260_230 != null) {
		// t260_230.getControl().setText("");
		// t260_280.getControl().setText("");
		// tAE.getControl().setText("");
		// tConcentrationADN.getControl().setText("");
		// tRangementADN.getControl().setText("");
		// tVolADN.getControl().setText("");
		// }
		if (prelevement.getCotationEnvoye() == 0) {
			lblCotationEnvoyee.setText("Cotation non envoyée");
			lblCotationEnvoyee.setBackground(new Color(Display.getCurrent(), 255, 0, 0));
		} else if (prelevement.getCotationEnvoye() == 1) {
			lblCotationEnvoyee.setText("Cotation à envoyer");
			lblCotationEnvoyee.setBackground(new Color(Display.getCurrent(), 85, 103, 239));
		} else if (prelevement.getCotationEnvoye() == 2) {
			lblCotationEnvoyee.setText("Cotation envoyée");
			lblCotationEnvoyee.setBackground(new Color(Display.getCurrent(), 132, 255, 178));
		}

		if (prelevement.getNumSejour() != null && !prelevement.getNumSejour().isEmpty()) {
			tNSejour.getControl().setText("" + prelevement.getNumSejour());
		}
		if (prelevement.getNumeroPrelevement() != null) {
			prelevementTabItem.setText(prelevement.getNumeroPrelevement());
			tNumeroPrelevement.setText(prelevement.getNumeroPrelevement());
		} else {
			prelevementTabItem.setText("nouveau prélèvement");
		}

		if (prelevement.getPrescripteur() != null) {
			comboPrescripteur.setSelection(new StructuredSelection(prelevement.getPrescripteur()), true);
		}
		if (prelevement.getPrescripteur2() != null) {
			comboPrescripteur2.setSelection(new StructuredSelection(prelevement.getPrescripteur2()), true);
		}
		if (prelevement.getPrescripteur3() != null) {
			comboPrescripteur3.setSelection(new StructuredSelection(prelevement.getPrescripteur3()), true);
		}

		if (prelevement.getUfPresc() != null) {
			tUFPrescr.setText("" + prelevement.getUfPresc());
		}
		if (prelevement.getNomPrenomAutrePresc() != null) {
			tNomPrenomAutrePresc.setText(prelevement.getNomPrenomAutrePresc());
		}
		ArrayList<Prelevement> listPrelevementsPatient = new ArrayList<Prelevement>();
		Prelevement prelVide = new Prelevement();
		prelVide.setIdPrelevement(0);
		listPrelevementsPatient.add(prelVide);
		listPrelevementsPatient.addAll(PrelevementServiceImpl.getInstance().getAutrePrelevementFromPatient(prelevement));

		comboDerive.setInput(listPrelevementsPatient);
		comboDerive.getCombo().pack(true);

		if (prelevement.getIdPrelevement() != 0) {
			// Prélèvement
			if (prelevement.getInfoIndication() != null) {
				tInfoIndication.setText(prelevement.getInfoIndication());
			}
			Secteur secteur = prelevement.getSecteur();

			if (secteur != null) {
				btnRadioPrenatal.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioPrenatal.getText()));
				btnRadioPostnatal.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioPostnatal.getText()));
				btnRadioFoeto.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioFoeto.getText()));
				btnRadioPucesFoeto.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioPucesFoeto.getText()));
				btnRadioPucesPost.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioPucesPost.getText()));
				btnRadioPucesPre.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioPucesPre.getText()));
				btnRadioBanques.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioBanques.getText()));
				btnRadioCellules.setSelection(prelevement.getSecteur().getLibelle().equals(btnRadioCellules.getText()));
			}

			if (prelevement.getDatePrelevement() != null) {
				datePrelev.setValue(prelevement.getDatePrelevement());
			}
			if (prelevement.getDateReception() != null) {
				dateReception.setValue(prelevement.getDateReception());
			}
			HashMap<String, String> champs = PrelevementServiceImpl.getInstance().getChampByIdObjet("Prel-" + prelevement.getIdPrelevement());

			if (prelevement.getSecteur().getLibelle().equals(btnRadioPrenatal.getText()) || prelevement.getSecteur().getLibelle().equals(btnRadioPucesPre.getText())) {
				// prenatal
				if (dateDG == null) {
					createPrenatal();
				}
				// Champ cddg =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("dateDG",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("dateDG")) {
					SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
					Date ddg;
					try {
						ddg = formater.parse(champs.get("dateDG"));
						dateDG.setValue(ddg);
					} catch (ParseException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
				if (champs.containsKey("comboPonctionneur") && champs.get("comboPonctionneur") != null && !champs.get("comboPonctionneur").isEmpty()) {
					Utilisateur ponctionneur = UtilisateurServiceImpl.getInstance().getUtilisateurById(Integer.parseInt(champs.get("comboPonctionneur")));
					comboPonctionneur.setSelection(new StructuredSelection(ponctionneur), true);
				}
				// Champ cdnm =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("dateNaissanceMere",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("dateNaissanceMere")) {
					SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
					Date dnm;
					try {
						dnm = formater.parse(champs.get("dateNaissanceMere"));
						dateNaissanceMere.setValue(dnm);
					} catch (ParseException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				} else {
					Personne p = PersonneServiceImpl.getInstance().getPersonneById(prelevement.getPersonne().getIdPersonne());
					if (p != null) {
						dateNaissanceMere.setValue(p.getDateNaissance());
					}
				}

				// Champ cSexeFoetus =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tSexeFoetus",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tSexeFoetus")) {
					String sexef = champs.get("tSexeFoetus");
					btnRadioSexefNA.setSelection(sexef.equals("NA"));
					btnRadioSexefF.setSelection(sexef.equals("F"));
					btnRadioSexefM.setSelection(sexef.equals("M"));
					btnRadioSexefI.setSelection(sexef.equals("I"));
				}

				// Champ ctAgeMat =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tAgeMat",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tAgeMat")) {
					tAgeMat.getControl().setText(champs.get("tAgeMat"));
				}
				// Champ ctAlphaSecond =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tAlphaSecond",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tAlphaSecond")) {
					tAlphaSecond.getControl().setText(champs.get("tAlphaSecond"));
				}
				// Champ ctBetaPrem =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tBetaPrem",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tBetaPrem")) {
					tBetaPrem.getControl().setText(champs.get("tBetaPrem"));
				}
				// Champ ctBetaSecond =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tBetaSecond",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tBetaSecond")) {
					tBetaSecond.getControl().setText(champs.get("tBetaSecond"));
				}
				// Champ ctMqSerique =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tMqSerique",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tMqSerique")) {
					tMqSerique.getControl().setText(champs.get("tMqSerique"));
				}
				// Champ ctLCCPrem =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tLCCPrem",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tLCCPrem")) {
					tLCCPrem.getControl().setText(champs.get("tLCCPrem"));
				}
				// Champ ctCombine =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tCombine",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tCombine")) {
					tCombine.getControl().setText(champs.get("tCombine"));
				}
				// Champ ctNuquePrem =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tNuquePrem",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tNuquePrem")) {
					tNuquePrem.getControl().setText(champs.get("tNuquePrem"));
				}
				// Champ ctPAPPAPrem =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tPAPPAPrem",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tPAPPAPrem")) {
					tPAPPAPrem.getControl().setText(champs.get("tPAPPAPrem"));
				}
				// Champ ctSequentielIntegre =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tSequentielIntegre",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tSequentielIntegre")) {
					tSequentielIntegre.getControl().setText(champs.get("tSequentielIntegre"));
				}
				// Champ ctSigneAppel =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tSigneAppel",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tSigneAppel")) {
					tSigneAppel.setText(champs.get("tSigneAppel"));
				}
				// Champ ctTerme =
				// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tTerme",
				// "Prel-" + prelevement.getIdPrelevement());
				if (champs.containsKey("tTerme")) {
					tTerme.getControl().setText(champs.get("tTerme"));
				}

			}

			if (prelevement.getTypePrelevement() != null) {
				if (prelevement.getTypePrelevement().getIdTypePrelevement() == 13) {
					if (btnCheckGarderCultureLA == null) {
						btnCheckGarderCultureLA = new Button(groupCulture, SWT.CHECK);
						btnCheckGarderCultureLA.setText("Garder les cultures");
						btnCheckGarderCultureLA.setFont(boldFont);

						Label lblDateMiseCultLA = new Label(groupCulture, SWT.NONE);
						lblDateMiseCultLA.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
						lblDateMiseCultLA.setFont(boldFont);
						lblDateMiseCultLA.setText("Date de mise en culture :");

						dateMiseEnCultureLA = new FormattedText(groupCulture, SWT.BORDER);
						GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
						gd_dateMiseEnCulture.widthHint = 75;
						dateMiseEnCultureLA.getControl().setLayoutData(gd_dateMiseEnCulture);
						dateMiseEnCultureLA.setFormatter(new DateFormatter("dd/MM/yyyy"));

					}
					groupCulture.setVisible(true);
					((GridData) groupCulture.getLayoutData()).exclude = false;
					if (champs.containsKey("nbLA")) {
						nbLA = Integer.parseInt(champs.get("nbLA"));
					}
					for (int i = 0; i < Math.max(comboVolCulotLA.size(), nbLA); i++) {
						if (comboVolCulotLA == null || comboVolCulotLA.size() <= i) {

							createGroupLA(i);
							createGroupeBoutonLA();
						}
						if (!comboVolCulotLA.get(i).isDisposed()) {

							// Champ ccomboAspectCulotLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboAspectCulotLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboAspectCulotLA-" + i)) {
								comboAspectCulotLA.get(i).setText(champs.get("comboAspectCulotLA-" + i));
							}
							// Champ ccomboAspectLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboAspectLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboAspectLA-" + i)) {
								comboAspectLA.get(i).setText(champs.get("comboAspectLA-" + i));
							}
							// Champ ccomboVolCulotLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboVolCulotLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboVolCulotLA-" + i)) {
								comboVolCulotLA.get(i).setText(champs.get("comboVolCulotLA-" + i));
							}
							// Champ ccomboVolLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboVolLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboVolLA-" + i)) {
								comboVolLA.get(i).setText(champs.get("comboVolLA-" + i));
							}
							// Champ ctASpecifierAspectCulotLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tASpecifierAspectCulotLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("tASpecifierAspectCulotLA-" + i)) {
								lblASpeAspectCulotLA.get(i).setVisible(true);
								tASpecifierAspectCulotLA.get(i).setVisible(true);
								tASpecifierAspectCulotLA.get(i).setText(champs.get("tASpecifierAspectCulotLA-" + i));
							}
							// Champ ctASpecifierAspectLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tASpecifierAspectLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("tASpecifierAspectLA-" + i)) {
								lblASpeAspectLA.get(i).setVisible(true);
								tASpecifierAspectLA.get(i).setVisible(true);
								tASpecifierAspectLA.get(i).setText(champs.get("tASpecifierAspectLA-" + i));
							}
							// Champ ctASpecifierVolLA =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tASpecifierVolLA-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("tASpecifierVolLA-" + i)) {
								tASpecifierVolLA.get(i).setText(champs.get("tASpecifierVolLA-" + i));
							}
							if (champs.containsKey("tCommentaireEnvoi-" + i) && tCommentaireEnvoi.size() > i) {
								tCommentaireEnvoi.get(i).setText(champs.get("tCommentaireEnvoi-" + i));
							}
							// Champ cbtnCheckEnvoye =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("btnCheckEnvoye-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("btnCheckEnvoye-" + i)) {
								btnCheckEnvoye.get(i).setSelection(Boolean.parseBoolean(champs.get("btnCheckEnvoye-" + i)));
								if (btnCheckEnvoye.get(i).getSelection()) {
									raisonEnvoi.get(i).setVisible(true);
									tCommentaireEnvoi.get(i).setVisible(true);
								} else {
									raisonEnvoi.get(i).setVisible(false);
									tCommentaireEnvoi.get(i).setVisible(false);
								}
								ssgpLA.get(i).pack();
								groupEchantillon.pack();
								composite_1.pack();
							}
						}
					}
					if (champs.containsKey("btnCheckGarderCultureLA") && btnCheckGarderCultureLA != null) {
						btnCheckGarderCultureLA.setSelection(Boolean.parseBoolean(champs.get("btnCheckGarderCultureLA")));
						if (btnCheckGarderCultureLA.getSelection()) {
							btnCheckGarderCultureLA.setBackground(new Color(Display.getCurrent(), 255, 0, 0));
							btnCheckGarderCultureLA.setForeground(new Color(Display.getCurrent(), 0, 0, 0));
						}
					}
					if (champs.containsKey("dateCultLA")) {
						SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
						Date dmc;
						try {
							dmc = formater.parse(champs.get("dateCultLA"));
							dateMiseEnCultureLA.setValue(dmc);
						} catch (ParseException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
					if (isModifiable) {
						setModifiableLA();
					}
					if (nbLA > 0) {
						gpLA.setVisible(true);
						((GridData) gpLA.getLayoutData()).exclude = false;

					}
				}
				if (prelevement.getTypePrelevement().getIdTypePrelevement() == 5) {
					// Fibro
					if (comboAspectFibro == null) {
						createGroupeFibro();
					}
					// Champ ccomboAspectFibro =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboAspectFibro",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("comboAspectFibro")) {
						comboAspectFibro.setText(champs.get("comboAspectFibro"));
					}
					// Champ ccomboVolFibro =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboVolFibro",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("dateCultF")) {
						comboVolFibro.setText(champs.get("dateCultF"));
					}
					// Champ champMiseEnCultureF =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("dateCultF",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("dateCultF")) {
						SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
						Date dmc;
						try {
							dmc = formater.parse(champs.get("dateCultF"));
							dateMiseEnCultureF.setValue(dmc);
						} catch (ParseException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
					gpF.setVisible(true);
					((GridData) gpF.getLayoutData()).exclude = false;

				}
				if (prelevement.getTypePrelevement().getIdTypePrelevement() == 4 || prelevement.getTypePrelevement().getIdTypePrelevement() == 8 || prelevement.getTypePrelevement().getIdTypePrelevement() == 22) {
					if (btnCheckGarderCultureVC == null) {
						btnCheckGarderCultureVC = new Button(groupCulture, SWT.CHECK);
						btnCheckGarderCultureVC.setText("Garder les cultures");
						btnCheckGarderCultureVC.setFont(boldFont);

						Label lblDateMiseCultVC = new Label(groupCulture, SWT.NONE);
						lblDateMiseCultVC.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
						lblDateMiseCultVC.setFont(boldFont);
						lblDateMiseCultVC.setText("Date de mise en culture :");

						dateMiseEnCultureVC = new FormattedText(groupCulture, SWT.BORDER);
						GridData gd_dateMiseEnCulture = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
						gd_dateMiseEnCulture.widthHint = 75;
						dateMiseEnCultureVC.getControl().setLayoutData(gd_dateMiseEnCulture);
						dateMiseEnCultureVC.setFormatter(new DateFormatter("dd/MM/yyyy"));

					}
					groupCulture.setVisible(true);
					((GridData) groupCulture.getLayoutData()).exclude = false;
					if (comboVolVC == null) {
						createGroupeVC();
					}
					if (champs.containsKey("comboVolVC")) {
						comboVolVC.setText(champs.get("comboVolVC"));
					}

					for (Button cAspectMacroVC : comboAspectMacroVC) {
						if (champs.get("comboAspectMacroVC") != null) {
							cAspectMacroVC.setSelection(champs.get("comboAspectMacroVC").contains(cAspectMacroVC.getText()));
						}
					}

					for (Button cAspectMicroVC : comboAspectMicroVC) {
						if (champs.get("comboAspectMicroVC") != null) {
							cAspectMicroVC.setSelection(champs.get("comboAspectMicroVC").contains(cAspectMicroVC.getText()));
						}
					}

					if (champs.containsKey("tASpecifierAspectMicroVC")) {
						tASpecifierAspectMicroVC.setText(champs.get("tASpecifierAspectMicroVC"));
					}
					if (champs.containsKey("tASpecifierAspectMacroVC")) {
						tASpecifierAspectMacroVC.setText(champs.get("tASpecifierAspectMacroVC"));
					}

					if (champs.containsKey("dateCultVC")) {
						SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
						Date dmc;
						try {
							dmc = formater.parse(champs.get("dateCultVC"));
							dateMiseEnCultureVC.setValue(dmc);
						} catch (ParseException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}

					if (champs.containsKey("btnCheckGarderCultureVC")) {
						btnCheckGarderCultureVC.setSelection(Boolean.parseBoolean(champs.get("btnCheckGarderCultureVC")));
						if (btnCheckGarderCultureVC.getSelection()) {
							btnCheckGarderCultureVC.setBackground(new Color(Display.getCurrent(), 255, 0, 0));
							btnCheckGarderCultureVC.setForeground(new Color(Display.getCurrent(), 0, 0, 0));
						}
					}

				}
				if (prelevement.getTypePrelevement().getIdTypePrelevement() == 1 || prelevement.getTypePrelevement().getIdTypePrelevement() == 2) {
					// SANG

					// Champ cnbSang =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("nbSang",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("nbSang")) {
						nbSang = Integer.parseInt(champs.get("nbSang"));
					}
					for (int i = 0; i < Math.max(comboAspectSang.size(), nbSang); i++) {

						if (comboAspectSang == null || comboAspectSang.size() <= i) {
							createGroupeSang(i);
							createGroupeBoutonSang();

						}
						if (!comboAspectSang.get(i).isDisposed()) {
							// Champ ccomboAspectSang =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboAspectSang-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboAspectSang-" + i) && comboAspectSang.size() > i) {
								comboAspectSang.get(i).setText(champs.get("comboAspectSang-" + i));
							}

							// Champ ccomboTube =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboTube-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboTube-" + i) && comboAspectSang.size() > i) {
								comboTube.get(i).setText(champs.get("comboTube-" + i));
							}
							// Champ ccomboVolSang =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("comboVolSang-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("comboVolSang-" + i) && comboVolSang.size() > i) {
								comboVolSang.get(i).setText(champs.get("comboVolSang-" + i));
							}
							// Champ ctRangementSang =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tRangementSang-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("tRangementSang-" + i) && tRangementSang.size() > i) {
								tRangementSang.get(i).setText(champs.get("tRangementSang-" + i));
							}
							// Champ ctCommentaireEnvoi =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tCommentaireEnvoi-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("tCommentaireEnvoi-" + i) && tCommentaireEnvoi.size() > i) {
								tCommentaireEnvoi.get(i).setText(champs.get("tCommentaireEnvoi-" + i));
							}
							// Champ ctASpecifierTube =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tASpecifierTube-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("tASpecifierTube-" + i) && tASpecifierTube.size() > i) {
								tASpecifierTube.get(i).setText(champs.get("tASpecifierTube-" + i));
							}
							// Champ cbtnCheckEnvoye =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("btnCheckEnvoye-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("btnCheckEnvoye-" + i)) {
								btnCheckEnvoye.get(i).setSelection(Boolean.parseBoolean(champs.get("btnCheckEnvoye-" + i)));
								if (btnCheckEnvoye.get(i).getSelection()) {
									raisonEnvoi.get(i).setVisible(true);
									tCommentaireEnvoi.get(i).setVisible(true);
								} else {
									raisonEnvoi.get(i).setVisible(false);
									tCommentaireEnvoi.get(i).setVisible(false);
								}
								ssgpS.get(i).pack();
								groupEchantillon.pack();
								composite_1.pack();
							}
							// Champ champMiseEnCultureS =
							// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("dateCultS-"
							// + i, "Prel-" + prelevement.getIdPrelevement());
							if (champs.containsKey("dateCultS-" + i)) {
								SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
								Date dmc;
								try {
									dmc = formater.parse(champs.get("dateCultS-" + i));
									dateMiseEnCultureS.get(i).setValue(dmc);
								} catch (ParseException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							}
							if (isModifiable) {
								setModifiableSang();
							}
						}
					}
					if (nbSang > 0) {
						gpS.setVisible(true);
						((GridData) gpS.getLayoutData()).exclude = false;

					}
				}
				if (prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_FOETO) || prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_POSTNATAL) || prelevement.getSecteur().getLibelle().equals(ApplicationContexte.SECTEUR_PUCE_PRENATAL)
						|| prelevement.getTypePrelevement().getIdTypePrelevement() == 11) {
					// ADN
					if (t260_230 == null) {
						createGroupeADN();
					}
					// Champ ct260_230 =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("t260_230",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("t260_230") && champs.get("t260_230") != null && !champs.get("t260_230").equals("null")) {
						t260_230.setValue(Float.parseFloat(champs.get("t260_230")));
					}
					// Champ ct260_280 =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("t260_280",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("t260_280") && champs.get("t260_280") != null && !champs.get("t260_280").equals("null")) {
						t260_280.setValue(Float.parseFloat(champs.get("t260_280")));
					}
					// Champ ctAE =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tAE",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tAE") && champs.get("tAE") != null && !champs.get("tAE").equals("null")) {
						tAE.setValue(Float.parseFloat(champs.get("tAE")));
					}
					// Champ ctConcentrationADN =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tConcentrationADN",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tConcentrationADN") && champs.get("tConcentrationADN") != null && !champs.get("tConcentrationADN").equals("null")) {
						tConcentrationADN.setValue(Float.parseFloat(champs.get("tConcentrationADN")));
					}
					// Champ ctRangementADN =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tRangementADN",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tRangementADN") && champs.get("tRangementADN") != null && !champs.get("tRangementADN").equals("null")) {
						tRangementADN.setText(champs.get("tRangementADN"));
					}
					// Champ ctVolADN =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tVolADN",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tVolADN") && champs.get("tVolADN") != null && !champs.get("tVolADN").equals("null")) {
						tVolADN.setValue(Float.parseFloat(champs.get("tVolADN")));
					}
					// Champ cdateExtraction =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("dateExtraction",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("dateExtraction")) {
						SimpleDateFormat formater = null;
						if (champs.get("dateExtraction") != null) {
							if (champs.get("dateExtraction").split("-")[0].length() == 2) {
								formater = new SimpleDateFormat("dd-MM-yyyy");
							}
							if (champs.get("dateExtraction").split("-")[0].length() == 4) {
								formater = new SimpleDateFormat("yyyy-MM-dd");
							}

							Date dExt;
							try {
								dExt = formater.parse(champs.get("dateExtraction"));
								dateExtraction.setValue(dExt);
								btnCheckExtraction.setSelection(true);
							} catch (ParseException e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}
						}
					}

					// ADN purif

					// Champ ct260_230purif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("t260_230purif",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("t260_230purif") && champs.get("t260_230purif") != null && !champs.get("t260_230purif").equals("null")) {
						t260_230purif.setValue(Float.parseFloat(champs.get("t260_230purif")));
					}
					// Champ ct260_280purif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("t260_280purif",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("t260_280purif") && champs.get("t260_280purif") != null && !champs.get("t260_280purif").equals("null")) {
						t260_280purif.setValue(Float.parseFloat(champs.get("t260_280purif")));
					}
					// Champ ctAEpurif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tAEpurif",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tAEpurif") && champs.get("tAEpurif") != null && !champs.get("tAEpurif").equals("null")) {
						tAEpurif.setValue(Float.parseFloat(champs.get("tAEpurif")));
					}
					// Champ ctConcentrationADNpurif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tConcentrationADNpurif",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tConcentrationADNpurif") && champs.get("tConcentrationADNpurif") != null && !champs.get("tConcentrationADNpurif").equals("null")) {
						tConcentrationADNpurif.setValue(Float.parseFloat(champs.get("tConcentrationADNpurif")));
					}
					// Champ ctRangementADNpurif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tRangementADNpurif",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tRangementADNpurif") && champs.get("tRangementADNpurif") != null && !champs.get("tRangementADNpurif").equals("null")) {
						tRangementADNpurif.setText(champs.get("tRangementADNpurif"));
					}
					// Champ ctVolADNpurif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tVolADNpurif",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tVolADNpurif") && champs.get("tVolADNpurif") != null && !champs.get("tVolADNpurif").equals("null")) {
						tVolADNpurif.setValue(Float.parseFloat(champs.get("tVolADNpurif")));
					}
					// Champ cdatePurif =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("datePurification",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("datePurification")) {
						SimpleDateFormat formater = null;
						if (champs.get("datePurification") != null) {
							if (champs.get("datePurification").split("-")[0].length() == 2) {
								formater = new SimpleDateFormat("dd-MM-yyyy");
							}
							if (champs.get("datePurification").split("-")[0].length() == 4) {
								formater = new SimpleDateFormat("yyyy-MM-dd");
							}

							Date dpurif;
							try {
								dpurif = formater.parse(champs.get("datePurification"));
								datePurification.setValue(dpurif);
								btnCheckPurification.setSelection(true);
							} catch (ParseException e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}
						}
					}

					// Champ ctTypeADN =
					// PrelevementServiceImpl.getInstance().getChampByTypeAndIdObjet("tTypeADN",
					// "Prel-" + prelevement.getIdPrelevement());
					if (champs.containsKey("tTypeADN")) {
						if (champs.get("tTypeADN").contains("Extraction")) {
							btnCheckExtraction.setSelection(true);
						}
						if (champs.get("tTypeADN").contains("Purification")) {
							btnCheckPurification.setSelection(true);
						}
						// else if (ctTypeADN.equals("Dilution")) {
						// btnRadioExtraction.setSelection(true);
						// }
					}

					if (champs.containsKey("nbEnvoiADN")) {
						nbEnvoiADN = Integer.parseInt(champs.get("nbEnvoiADN"));
					}

					if (nbEnvoiADN > 0) {
						if (gpEnvoiADN == null) {
							gpEnvoiADN = new Group(gpAD, SWT.NONE);
							gpEnvoiADN.setLayout(new GridLayout(4, false));
							gpEnvoiADN.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));

						}
						for (int i = 0; i < Math.max(tVolEnvoye.size(), nbEnvoiADN); i++) {

							if (tVolEnvoye == null || tVolEnvoye.size() <= i) {
								createGroupeEnvoiADN(i);
							}
							if (champs.containsKey("tVolEnvoye-" + i) && tVolEnvoye.size() > i) {
								tVolEnvoye.get(i).setValue(Long.parseLong(champs.get("tVolEnvoye-" + i)));
							}

							SimpleDateFormat formater = null;

							if (champs.containsKey("dateEnvoi-" + i) && dateEnvoi.size() > i) {

								if (champs.get("dateEnvoi-" + i).split("-")[0].length() == 2) {
									formater = new SimpleDateFormat("dd-MM-yyyy");
								}
								if (champs.get("dateEnvoi-" + i).split("-")[0].length() == 4) {
									formater = new SimpleDateFormat("yyyy-MM-dd");
								}

								Date dEnvoi = null;

								try {
									dEnvoi = formater.parse(champs.get("dateEnvoi-" + i));
								} catch (ParseException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
								dateEnvoi.get(i).setValue(dEnvoi);

							}

							if (champs.containsKey("dateDemande-" + i) && dateEnvoi.size() > i) {

								if (champs.get("dateDemande-" + i).split("-")[0].length() == 2) {
									formater = new SimpleDateFormat("dd-MM-yyyy");
								}
								if (champs.get("dateDemande-" + i).split("-")[0].length() == 4) {
									formater = new SimpleDateFormat("yyyy-MM-dd");
								}

								Date dDem = null;

								try {
									dDem = formater.parse(champs.get("dateDemande-" + i));
								} catch (ParseException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
								dateDemande.get(i).setValue(dDem);

							}
							if (champs.containsKey("comboDemandeur-" + i) && comboDemandeur.size() > i) {
								Utilisateur u = UtilisateurServiceImpl.getInstance().getUtilisateurById(Integer.parseInt(champs.get("comboDemandeur-" + i)));
								if (u != null) {
									comboDemandeur.get(i).setSelection(new StructuredSelection(u));
								}
							}

						}
					}

				}
			}
			if (gpListeAnalyse == null) {
				gpListeAnalyse = new Group(composite_1, SWT.NONE);
				gpListeAnalyse.setLayout(new GridLayout(2, false));
				gpListeAnalyse.setText("Analyses réalisées sur le prélèvement");

				listAnalyse = new List(gpListeAnalyse, SWT.BORDER);
				listAnalyse.setToolTipText("Liste des analyses réalisées sur le prélèvement");
				java.util.List<Analyse> analyses = AnalyseServiceImpl.getInstance().findAllByidPrelevement(prelevement.getIdPrelevement());
				for (Analyse analyse : analyses) {
					String txt = "";
					if (analyse.isUrgent()) {
						txt = "URGENT! ";
					}
					listAnalyse.add(txt + analyse.getTypeAnalyse().getLibelle() + " n°" + analyse.getIdAnalyse());
				}
				listAnalyse.pack();
				if (DroitServiceImpl.getInstance().peutLireByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "analyse")) {
					listAnalyse.addMouseListener(new MouseListener() {

						public void mouseDoubleClick(MouseEvent e) {
							String[] titres = listAnalyse.getSelection();
							String idAnalyse = titres[0].substring(titres[0].indexOf("n°") + 2);
							Analyse a = AnalyseServiceImpl.getInstance().getAnalyseByIdAnalyse(Integer.parseInt(idAnalyse));
							if (a != null) {
								IEditorPart editeurActif = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
								if (editeurActif instanceof DossierEditor) {
									DossierEditor editeur = (DossierEditor) editeurActif;
									if (editeur.getPrelevementTabItems().containsKey(a.getIdAnalyse())) {
										editeur.getTabFolder().setSelection(editeur.getPrelevementTabItems().get(a.getIdAnalyse()).getTabItem());
									} else {
										editeur.addAnalyseTabItem(a);

									}
								}
							}
						}

						public void mouseDown(MouseEvent e) {
						}

						public void mouseUp(MouseEvent e) {
						}
					});
				}
				btnAjouterUneAnalyse = new Button(gpListeAnalyse, SWT.NONE);
				btnAjouterUneAnalyse.setImage(ResourceManager.getPluginImage("visiopuce", "icons/plusAnalyse.png"));
				btnAjouterUneAnalyse.setToolTipText("Ajouter une analyse");
				btnAjouterUneAnalyse.addSelectionListener(new SelectionAdapter() {
					public void widgetSelected(SelectionEvent e) {
						if (!((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).isModifiable()) {
							((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).getItemModifier().notifyListeners(SWT.Selection, null);
						}
						if (((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).isModifiable()) {
							Analyse newAnalyse = new Analyse();
							newAnalyse.setIdAnalyse(0);
							newAnalyse.setPrelevement(getPrelevement());
							((DossierEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()).addAnalyseTabItem(newAnalyse);
						}
					}
				});
				if (btnAjouterUneAnalyse != null) {
					btnAjouterUneAnalyse.setEnabled(DroitServiceImpl.getInstance().peutCreerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "analyse"));
					itemAddAnalyse.setEnabled(DroitServiceImpl.getInstance().peutCreerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "analyse"));
				}
			}
			if (gpListeDocument == null && this.prelevement.getNumeroPrelevement() != null) {
				gpListeDocument = new Group(composite_1, SWT.NONE);
				gpListeDocument.setLayout(new GridLayout(1, false));
				gpListeDocument.setText("Documents liés à l'échantillon");
			}
			if (this.prelevement.getNumeroPrelevement() != null) {
				Control[] controles = gpListeDocument.getChildren();
				for (Control control : controles) {
					control.dispose();
				}

				createLinksResulatats();
				File file2 = new File(ApplicationContexte.REPERTOIRE_PROTOCOLE);
				createLinks(file2);
				btnAjouterUnDocument = new Button(gpListeDocument, SWT.NONE);
				btnAjouterUnDocument.setToolTipText("Ajouter un document");
				btnAjouterUnDocument.setImage(ResourceManager.getPluginImage("visiopuce", "icons/download.png"));
				btnAjouterUnDocument.addSelectionListener(new SelectionAdapter() {
					public void widgetSelected(SelectionEvent e) {
						FileDialog dlg = new FileDialog(btnAjouterUnDocument.getShell(), SWT.OPEN);
						dlg.setText("Ajouter le document");
						String path = dlg.open();

						if (path != null && path.contains(prelevement.getNumeroPrelevement())) {

							FileInputStream filesource;
							FileOutputStream fileDestination;
							try {
								filesource = new FileInputStream(path);
								String nomFichier = path.substring(path.lastIndexOf("\\") + 1);
								String repResultat = "";
								if (Character.isDigit(prelevement.getNumeroPrelevement().charAt(1))) {
									repResultat = ApplicationContexte.REPERTOIRE_RESULTAT + "activité 20" + prelevement.getNumeroPrelevement().substring(1, 3) + "\\" + prelevement.getNumeroPrelevement().substring(0, 1) + "\\";
								} else {
									if (Character.isDigit(prelevement.getNumeroPrelevement().charAt(2))) {
										repResultat = ApplicationContexte.REPERTOIRE_RESULTAT + "activité 20" + prelevement.getNumeroPrelevement().substring(2, 4) + "\\" + prelevement.getNumeroPrelevement().substring(0, 2) + "\\";
									}
								}
								fileDestination = new FileOutputStream(repResultat + "\\" + nomFichier);
								byte buffer[] = new byte[512 * 1024];
								int nblecture;
								while ((nblecture = filesource.read(buffer)) != -1) {
									fileDestination.write(buffer, 0, nblecture);
								}
								String message = "<a href=\"" + nomFichier + "\">" + nomFichier + "</a>";
								final Link lblLienDoc = new Link(gpListeDocument, SWT.NONE);
								lblLienDoc.setText(message);
								lblLienDoc.setToolTipText(path);
								lblLienDoc.getParent().pack();
								lblLienDoc.getParent().getParent().pack();
								lblLienDoc.addSelectionListener(new SelectionListener() {

									@Override
									public void widgetSelected(SelectionEvent e) {
										try {
											File fichierResultat = new File(lblLienDoc.getToolTipText());
											Desktop desktop = Desktop.getDesktop();
											fichierResultat.setWritable(true);
											desktop.open(fichierResultat);
										} catch (IOException e1) {
											// TODO Auto-generated catch block
											e1.printStackTrace();
										}
									}

									@Override
									public void widgetDefaultSelected(SelectionEvent e) {
										// TODO Auto-generated method stub

									}
								});
								filesource.close();
								fileDestination.close();
							} catch (FileNotFoundException e2) {
								MessageDialog.openError(Display.getCurrent().getActiveShell(), "Fichier manquant", "Erreur lors de l'enregistrement du fichier, fichier manquant");
							} catch (IOException e3) {
								e3.printStackTrace();
							}
						} else {
							MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Mauvais fichier", "Ce fichier ne peut pas être lié à ce prélèvement, le numéro de dossier doit être contenu dans le nom du fichier");
						}
					}
				});

				gpListeDocument.pack();
				gpListeDocument.getParent().pack();
			}
			if (secteur != null) {
				changeFormulaireParSecteur(prelevement.getSecteur().getLibelle());
				if (prelevement.getDerive() != null) {
					comboDerive.setSelection(new StructuredSelection(prelevement.getDerive()), true);
				}
				if (prelevement.getTypePrelevement() != null) {
					comboTypeEchantillon.setSelection(new StructuredSelection(prelevement.getTypePrelevement()), true);
					comboTypeEchantillon.getCombo().notifyListeners(SWT.Selection, new Event());
				}
				if (prelevement.getIndication() != null) {
					comboTypeIndication.setSelection(new StructuredSelection(prelevement.getIndication()), true);
				}
				btnCheckDpi.setSelection(prelevement.isDpi());
				btnCheckRecherche.setSelection(prelevement.isRecherche());
			}
		}
		setModifiable(isModifiable);
		composite_1.pack();
		sc1.redraw();

		addDirtyListener();
	}

	private void createLinks(File file) {

		File[] files = file.listFiles();
		if (files != null) {
			for (int i = 0; i < files.length; i++) {
				if (files[i].isDirectory() != true && (files[i].getName().contains(prelevement.getNumeroPrelevement()) || files[i].getName().contains(prelevement.getNumeroPrelevement() + ".doc"))) {
					String message = "<a href=\"" + files[i].getName() + "\">" + files[i].getName() + "</a>";
					final Link lblLienDoc = new Link(gpListeDocument, SWT.NONE);
					lblLienDoc.setText(message);
					lblLienDoc.setToolTipText(files[i].getPath());
					lblLienDoc.getParent().pack();
					lblLienDoc.addSelectionListener(new SelectionListener() {

						@Override
						public void widgetSelected(SelectionEvent e) {
							try {
								File fichierResultat = new File(lblLienDoc.getToolTipText());
								Desktop desktop = Desktop.getDesktop();
								fichierResultat.setWritable(true);
								desktop.open(fichierResultat);
							} catch (IOException e1) {
								// TODO Auto-generated catch block
								e1.printStackTrace();
							}
						}

						@Override
						public void widgetDefaultSelected(SelectionEvent e) {
							// TODO Auto-generated method stub

						}
					});
				}
			}
		}
	}

	private void createLinksResulatats() {
		String repResultat = "";
		if (Character.isDigit(prelevement.getNumeroPrelevement().charAt(1))) {
			repResultat = ApplicationContexte.REPERTOIRE_RESULTAT + "activité 20" + prelevement.getNumeroPrelevement().substring(1, 3) + "\\" + prelevement.getNumeroPrelevement().substring(0, 1) + "\\";
		} else {
			if (Character.isDigit(prelevement.getNumeroPrelevement().charAt(2))) {
				repResultat = ApplicationContexte.REPERTOIRE_RESULTAT + "activité 20" + prelevement.getNumeroPrelevement().substring(2, 4) + "\\" + prelevement.getNumeroPrelevement().substring(0, 2) + "\\";
			}
		}

		File rep = new File(repResultat);
		File[] files = rep.listFiles();
		if (files != null) {
			for (int i = 0; i < files.length; i++) {
				if (files[i].isDirectory() != true && (files[i].getName().contains(prelevement.getNumeroPrelevement()) || files[i].getName().contains(prelevement.getNumeroPrelevement() + ".doc"))) {
					String message = "<a href=\"" + files[i].getName() + "\">" + files[i].getName() + "</a>";
					final Link lblLienDoc = new Link(gpListeDocument, SWT.NONE);
					lblLienDoc.setText(message);
					lblLienDoc.setToolTipText(files[i].getPath());
					lblLienDoc.getParent().pack();
					lblLienDoc.addSelectionListener(new SelectionListener() {

						@Override
						public void widgetSelected(SelectionEvent e) {
							try {
								File fichierResultat = new File(lblLienDoc.getToolTipText());
								Desktop desktop = Desktop.getDesktop();
								fichierResultat.setWritable(true);
								desktop.open(fichierResultat);
							} catch (IOException e1) {
								// TODO Auto-generated catch block
								e1.printStackTrace();
							}
						}

						@Override
						public void widgetDefaultSelected(SelectionEvent e) {
							// TODO Auto-generated method stub

						}
					});
				}
			}
		}
	}

	public void setModifiable(final boolean isModifiable) {
		removeDirtyListener();
		this.isModifiable = isModifiable;
		if (!isModifiable) {
			// prélèvement
			tNSejour.getControl().setEditable(false);
			tNumeroPrelevement.setEditable(false);
			tInfoIndication.setEditable(false);
			btnRadioBanques.setEnabled(false);
			btnRadioCellules.setEnabled(false);
			btnRadioPostnatal.setEnabled(false);
			btnRadioPrenatal.setEnabled(false);
			btnRadioPucesPost.setEnabled(false);
			btnRadioPucesPre.setEnabled(false);
			btnRadioPucesFoeto.setEnabled(false);
			btnRadioFoeto.setEnabled(false);
			btnCheckRecherche.setEnabled(false);
			btnCheckDpi.setEnabled(false);
			comboDerive.getCombo().setEnabled(false);
			comboTypeEchantillon.getCombo().setEnabled(false);
			comboTypeIndication.getCombo().setEnabled(false);
			datePrelev.getControl().setEnabled(false);
			dateReception.getControl().setEnabled(false);
			comboPrescripteur.getCombo().setEnabled(false);
			comboPrescripteur2.getCombo().setEnabled(false);
			comboPrescripteur3.getCombo().setEnabled(false);
			tUFPrescr.setEnabled(false);
			tNomPrenomAutrePresc.setEnabled(false);

			// prénatal
			if (dateDG != null && !dateDG.getControl().isDisposed()) {
				dateDG.getControl().setEnabled(false);
				comboPonctionneur.getCombo().setEnabled(false);
				dateNaissanceMere.getControl().setEnabled(false);
				tAgeMat.getControl().setEditable(false);
				tAlphaSecond.getControl().setEditable(false);
				tBetaPrem.getControl().setEditable(false);
				tBetaSecond.getControl().setEditable(false);
				tMqSerique.getControl().setEditable(false);
				tLCCPrem.getControl().setEditable(false);
				tCombine.getControl().setEditable(false);
				tNuquePrem.getControl().setEditable(false);
				tPAPPAPrem.getControl().setEditable(false);
				tSequentielIntegre.getControl().setEditable(false);
				tSigneAppel.setEditable(false);
				tTerme.getControl().setEditable(false);
				btnRadioSexefF.setEnabled(false);
				btnRadioSexefM.setEnabled(false);
				btnRadioSexefNA.setEnabled(false);
				btnRadioSexefI.setEnabled(false);
			}

			// LA
			for (int i = 0; i < nbLA; i++) {
				if (comboAspectCulotLA != null && comboAspectCulotLA.size() > i && !comboAspectCulotLA.get(i).isDisposed()) {

					comboAspectCulotLA.get(i).setEnabled(false);
					comboAspectLA.get(i).setEnabled(false);
					comboVolCulotLA.get(i).setEnabled(false);
					comboVolLA.get(i).setEnabled(false);
					tASpecifierAspectCulotLA.get(i).setEditable(false);
					tASpecifierAspectLA.get(i).setEditable(false);
					tASpecifierVolLA.get(i).setEditable(false);

					if (bSupLA.size() > i) {
						bSupLA.get(i).setEnabled(false);
					}
					btnCheckEnvoye.get(i).setEnabled(false);
					tCommentaireEnvoi.get(i).setEditable(false);
				}
			}
			if (btnCheckGarderCultureLA != null) {
				btnCheckGarderCultureLA.setEnabled(false);
			}
			if (dateMiseEnCultureLA != null) {
				dateMiseEnCultureLA.getControl().setEditable(false);
			}

			if (bGenererFeuilleCultureLA != null) {
				bGenererFeuilleCultureLA.setEnabled(false);
			}

			// VC
			if (btnCheckGarderCultureVC != null && !btnCheckGarderCultureVC.isDisposed()) {
				btnCheckGarderCultureVC.setEnabled(false);
				for (Button cAspectMacroVC : comboAspectMacroVC) {
					cAspectMacroVC.setEnabled(false);
				}
				for (Button cAspectMicroVC : comboAspectMicroVC) {
					cAspectMicroVC.setEnabled(false);
				}
				comboVolVC.setEnabled(false);
				tASpecifierAspectMacroVC.setEditable(false);
				tASpecifierAspectMicroVC.setEditable(false);
				dateMiseEnCultureVC.getControl().setEditable(false);
				bGenererFeuilleCultureVC.setEnabled(false);
			}

			// Fibro
			if (comboAspectFibro != null && !comboAspectFibro.isDisposed()) {
				comboAspectFibro.setEnabled(false);
				comboVolFibro.setEnabled(false);
				dateMiseEnCultureF.getControl().setEditable(false);
				bGenererFeuilleCultureF.setEnabled(false);
			}

			// SANG
			for (int i = 0; i < nbSang; i++) {
				if (comboAspectSang != null && comboAspectSang.size() > i && !comboAspectSang.get(i).isDisposed()) {
					comboAspectSang.get(i).setEnabled(false);
					comboTube.get(i).setEnabled(false);
					comboVolSang.get(i).setEnabled(false);
					tRangementSang.get(i).setEditable(false);

					tASpecifierTube.get(i).setEditable(false);
					btnCheckEnvoye.get(i).setEnabled(false);
					tCommentaireEnvoi.get(i).setEditable(false);
					dateMiseEnCultureS.get(i).getControl().setEditable(false);

					if (bSupS.size() > i) {
						bSupS.get(i).setEnabled(false);
					}
				}
			}
			if (bGenererFeuilleCultureS != null) {
				bGenererFeuilleCultureS.setEnabled(false);
			}
			// ADN
			if (t260_230 != null && !t260_230.getControl().isDisposed()) {
				t260_230.getControl().setEditable(false);
				t260_280.getControl().setEditable(false);
				tAE.getControl().setEditable(false);
				tConcentrationADN.getControl().setEditable(false);
				tRangementADN.setEditable(false);
				tVolADN.getControl().setEditable(false);
				dateExtraction.getControl().setEnabled(false);

				t260_230purif.getControl().setEditable(false);
				t260_280purif.getControl().setEditable(false);
				tAEpurif.getControl().setEditable(false);
				tConcentrationADNpurif.getControl().setEditable(false);
				tRangementADNpurif.setEditable(false);
				tVolADNpurif.getControl().setEditable(false);
				datePurification.getControl().setEnabled(false);
				btnEnvoyerADN.setEnabled(false);
				btnCheckExtraction.setEnabled(false);
				btnCheckPurification.setEnabled(false);

				for (int i = 0; i < comboDemandeur.size(); i++) {
					if (tVolEnvoye != null && tVolEnvoye.get(i) != null && !tVolEnvoye.get(i).getControl().isDisposed()) {
						tVolEnvoye.get(i).getControl().setEditable(false);
						dateEnvoi.get(i).getControl().setEditable(false);
						dateDemande.get(i).getControl().setEditable(false);
						comboDemandeur.get(i).getCombo().setEnabled(false);
						btnFormulaireEnvoi.get(i).setEnabled(false);

					}
				}

				// btnRadioDilution.setEnabled(false);
			}

		} else {
			tNSejour.getControl().setEditable(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tNSejour"));
			comboPrescripteur.getCombo().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboPrescripteur"));
			comboPrescripteur2.getCombo().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboPrescripteur"));
			comboPrescripteur3.getCombo().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboPrescripteur"));
			tUFPrescr.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tUFPrescr"));
			tNomPrenomAutrePresc.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tNomPrenomAutrePresc"));

			if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tNumeroPrelevement") && prelevement != null && prelevement.getIdPrelevement() > 0 && isModifiable) {
				bModifierNumero.setEnabled(true);
				Listener[] lists = bModifierNumero.getListeners(SWT.Selection);
				for (Listener listener : lists) {
					if (listener instanceof SelectionListener) {
						bModifierNumero.removeSelectionListener((SelectionListener) listener);
					}
				}

				bModifierNumero.addSelectionListener(new SelectionListener() {

					@Override
					public void widgetSelected(SelectionEvent e) {
						NumPrelevDialog nmPrelev = new NumPrelevDialog(Display.getCurrent().getActiveShell(), "Changement de numero de prélèvement", prelevement.getIdPrelevement());
						if (nmPrelev.open() == IDialogConstants.OK_ID) {
							tNumeroPrelevement.setText(nmPrelev.getNumero());
						}
					}

					@Override
					public void widgetDefaultSelected(SelectionEvent e) {
						// TODO Auto-generated method stub

					}
				});
			}

			boolean peutModifierSecteur = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "btnRadioSecteur");
			// tNumeroPrelevement.setEditable(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(),
			// "tNumeroPrelevement"));
			tInfoIndication.setEditable(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tInfoIndication"));
			btnRadioBanques.setEnabled(peutModifierSecteur);
			btnRadioCellules.setEnabled(peutModifierSecteur);
			btnRadioPostnatal.setEnabled(peutModifierSecteur);
			btnRadioPrenatal.setEnabled(peutModifierSecteur);
			btnRadioPucesPost.setEnabled(peutModifierSecteur);
			btnRadioPucesPre.setEnabled(peutModifierSecteur);
			btnRadioPucesFoeto.setEnabled(peutModifierSecteur);
			btnRadioFoeto.setEnabled(peutModifierSecteur);
			btnRadioPucesPre.setEnabled(peutModifierSecteur);
			btnCheckRecherche.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "btnCheckRecherche"));
			btnCheckDpi.setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "btnCheckDpi"));
			comboDerive.getCombo().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboDerive"));
			comboTypeEchantillon.getCombo().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboTypeEchantillon"));
			comboTypeIndication.getCombo().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboTypeIndication"));
			datePrelev.getControl().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "datePrelev"));
			dateReception.getControl().setEnabled(DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "dateReception"));

			// prenatal
			if (dateDG != null && !dateDG.getControl().isDisposed()) {
				boolean peutModifierPrenatal = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champPrenatal");
				dateDG.getControl().setEnabled(peutModifierPrenatal);
				comboPonctionneur.getCombo().setEnabled(peutModifierPrenatal);
				dateNaissanceMere.getControl().setEnabled(peutModifierPrenatal);
				tAgeMat.getControl().setEditable(peutModifierPrenatal);
				tAlphaSecond.getControl().setEditable(peutModifierPrenatal);
				tBetaPrem.getControl().setEditable(peutModifierPrenatal);
				tBetaSecond.getControl().setEditable(peutModifierPrenatal);
				tMqSerique.getControl().setEditable(peutModifierPrenatal);
				tLCCPrem.getControl().setEditable(peutModifierPrenatal);
				tCombine.getControl().setEditable(peutModifierPrenatal);
				tNuquePrem.getControl().setEditable(peutModifierPrenatal);
				tPAPPAPrem.getControl().setEditable(peutModifierPrenatal);
				tSequentielIntegre.getControl().setEditable(peutModifierPrenatal);
				tSigneAppel.setEditable(peutModifierPrenatal);
				tTerme.getControl().setEditable(peutModifierPrenatal);
				btnRadioSexefF.setEnabled(peutModifierPrenatal);
				btnRadioSexefM.setEnabled(peutModifierPrenatal);
				btnRadioSexefNA.setEnabled(peutModifierPrenatal);
				btnRadioSexefI.setEnabled(peutModifierPrenatal);
			}

			// LA

			setModifiableLA();

			// VC
			if (btnCheckGarderCultureVC != null && !btnCheckGarderCultureVC.isDisposed()) {
				boolean peutModifierVC = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champVC");
				btnCheckGarderCultureVC.setEnabled(peutModifierVC);
				for (Button cAspectMacroVC : comboAspectMacroVC) {
					cAspectMacroVC.setEnabled(peutModifierVC);
				}
				for (Button cAspectMicroVC : comboAspectMicroVC) {
					cAspectMicroVC.setEnabled(peutModifierVC);
				}
				comboVolVC.setEnabled(peutModifierVC);
				tASpecifierAspectMacroVC.setEditable(peutModifierVC);
				tASpecifierAspectMicroVC.setEditable(peutModifierVC);
				dateMiseEnCultureVC.getControl().setEditable(peutModifierVC);
				bGenererFeuilleCultureVC.setEnabled(peutModifierVC);
			}

			// Fibro
			if (comboAspectFibro != null && !comboAspectFibro.isDisposed()) {
				boolean peutModifierFibro = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champFibro");
				comboAspectFibro.setEnabled(peutModifierFibro);
				comboVolFibro.setEnabled(peutModifierFibro);
				dateMiseEnCultureF.getControl().setEditable(peutModifierFibro);
				bGenererFeuilleCultureF.setEnabled(peutModifierFibro);
			}

			// SANG

			setModifiableSang();

			setModifiableEnvoiADN();

			addDirtyListener();
		}
		if (btnAjouterUneAnalyse != null && !btnAjouterUneAnalyse.isDisposed()) {
			btnAjouterUneAnalyse.setEnabled(DroitServiceImpl.getInstance().peutCreerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "analyse"));
			itemAddAnalyse.setEnabled(DroitServiceImpl.getInstance().peutCreerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "analyse"));
		}

		if (btnAjouterUnDocument != null && !btnAjouterUnDocument.isDisposed()) {
			btnAjouterUnDocument.setEnabled(DroitServiceImpl.getInstance().peutCreerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "document"));
		}
		if (DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champSang") || DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champLA") && isModifiable) {
			if (bModifierNnbChamp != null) {
				bModifierNnbChamp.setEnabled(true);
				Listener[] lists = bModifierNnbChamp.getListeners(SWT.Selection);
				for (Listener listener : lists) {
					if (listener instanceof SelectionListener) {
						bModifierNnbChamp.removeSelectionListener((SelectionListener) listener);
					}
				}
				if (isModifiable) {
					bModifierNnbChamp.addSelectionListener(addTubeSelectionListener);

				}
			}
		}
	}

	private void setModifiableLA() {
		removeModifyListenerLA();
		boolean peutModifierLA = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champLA");
		for (int i = 0; i < nbLA; i++) {
			if (comboAspectCulotLA != null && comboAspectCulotLA.get(i) != null && !comboAspectCulotLA.get(i).isDisposed()) {

				comboAspectCulotLA.get(i).setEnabled(peutModifierLA);
				comboAspectLA.get(i).setEnabled(peutModifierLA);
				comboVolCulotLA.get(i).setEnabled(peutModifierLA);
				comboVolLA.get(i).setEnabled(peutModifierLA);
				tASpecifierAspectCulotLA.get(i).setEditable(peutModifierLA);
				tASpecifierAspectLA.get(i).setEditable(peutModifierLA);
				tASpecifierVolLA.get(i).setEditable(peutModifierLA);

				btnCheckEnvoye.get(i).setEnabled(peutModifierLA);
				tCommentaireEnvoi.get(i).setEditable(peutModifierLA);
				if (bSupLA.size() > i) {
					bSupLA.get(i).setEnabled(DroitServiceImpl.getInstance().peutSupprimerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champLA"));
				}
			}
		}
		if (btnCheckGarderCultureLA != null) {
			btnCheckGarderCultureLA.setEnabled(peutModifierLA);
		}
		if (dateMiseEnCultureLA != null) {
			dateMiseEnCultureLA.getControl().setEditable(peutModifierLA);
		}
		if (bGenererFeuilleCultureLA != null) {
			bGenererFeuilleCultureLA.setEnabled(peutModifierLA);
		}
		addModifyListenerLA();
	}

	private void setModifiableSang() {
		removeModifyListenerSang();
		boolean peutModifierSang = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champSang");
		boolean puer = false;
		if (ApplicationContexte.getInstance().getUtilisateur().getFonction() != null) {
			puer = ApplicationContexte.getInstance().getUtilisateur().getFonction().equals("Puericultrice");
		}

		for (int i = 0; i < nbSang; i++) {
			if (comboAspectSang != null && comboAspectSang.get(i) != null && !comboAspectSang.get(i).isDisposed()) {
				comboAspectSang.get(i).setEnabled(peutModifierSang);
				comboTube.get(i).setEnabled(peutModifierSang);
				comboVolSang.get(i).setEnabled(peutModifierSang);
				tRangementSang.get(i).setEditable(peutModifierSang || puer);
				tASpecifierTube.get(i).setEditable(peutModifierSang);
				btnCheckEnvoye.get(i).setEnabled(peutModifierSang || puer);
				tCommentaireEnvoi.get(i).setEditable(peutModifierSang || puer);
				dateMiseEnCultureS.get(i).getControl().setEditable(peutModifierSang);

				if (bSupS.size() > i) {
					bSupS.get(i).setEnabled(DroitServiceImpl.getInstance().peutSupprimerByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champSang"));
				}

			}
		}
		if (bGenererFeuilleCultureS != null) {
			bGenererFeuilleCultureS.setEnabled(peutModifierSang);
		}
		addModifyListenerS();
	}

	private void setModifiableEnvoiADN() {
		if (t260_230 != null) {
			removeModifyListenerADN();
			boolean peutModifierADN = DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champADN");
			t260_230.getControl().setEditable(peutModifierADN);
			t260_280.getControl().setEditable(peutModifierADN);
			tAE.getControl().setEditable(peutModifierADN);
			tConcentrationADN.getControl().setEditable(peutModifierADN);
			tRangementADN.setEditable(peutModifierADN);
			tVolADN.getControl().setEditable(peutModifierADN);
			dateExtraction.getControl().setEnabled(peutModifierADN);

			t260_230purif.getControl().setEditable(peutModifierADN);
			t260_280purif.getControl().setEditable(peutModifierADN);
			tAEpurif.getControl().setEditable(peutModifierADN);
			tConcentrationADNpurif.getControl().setEditable(peutModifierADN);
			tRangementADNpurif.setEditable(peutModifierADN);
			tVolADNpurif.getControl().setEditable(peutModifierADN);
			datePurification.getControl().setEnabled(peutModifierADN);
			btnEnvoyerADN.setEnabled(peutModifierADN);
			btnCheckExtraction.setEnabled(peutModifierADN);
			btnCheckPurification.setEnabled(peutModifierADN);

			for (int i = 0; i < nbEnvoiADN; i++) {
				if (tVolEnvoye != null && tVolEnvoye.get(i) != null && !tVolEnvoye.get(i).getControl().isDisposed()) {
					tVolEnvoye.get(i).getControl().setEnabled(peutModifierADN);
					dateEnvoi.get(i).getControl().setEnabled(peutModifierADN);
					dateDemande.get(i).getControl().setEnabled(peutModifierADN);
					comboDemandeur.get(i).getControl().setEnabled(peutModifierADN);
					btnFormulaireEnvoi.get(i).setEnabled(peutModifierADN);

				}
			}
			addModifyListenerADN();
		}
	}

	private void removeDirtyListener() {
		// prelévement
		tNSejour.getControl().removeModifyListener(modifyListener);
		tNumeroPrelevement.removeModifyListener(modifyListener);
		tInfoIndication.removeModifyListener(modifyListener);
		btnRadioBanques.removeSelectionListener(selectionListener);
		btnRadioCellules.removeSelectionListener(selectionListener);
		btnRadioPostnatal.removeSelectionListener(selectionListener);
		btnRadioPrenatal.removeSelectionListener(selectionListener);
		btnRadioPucesPost.removeSelectionListener(selectionListener);
		btnRadioFoeto.removeSelectionListener(selectionListener);
		btnRadioPucesFoeto.removeSelectionListener(selectionListener);
		btnRadioPucesPre.removeSelectionListener(selectionListener);
		btnCheckRecherche.removeSelectionListener(selectionListener);
		btnCheckDpi.removeSelectionListener(selectionListener);
		comboDerive.getCombo().removeModifyListener(modifyListener);
		comboTypeEchantillon.getCombo().removeModifyListener(modifyListener);
		comboTypeIndication.getCombo().removeModifyListener(modifyListener);
		datePrelev.getControl().removeModifyListener(modifyListener);
		dateReception.getControl().removeModifyListener(modifyListener);
		comboTypeEchantillon.removeSelectionChangedListener(comboTypeEchantillonSelectionChangedListener);
		comboPrescripteur.removeSelectionChangedListener(selectionChangedComboPresc);
		comboPrescripteur.getCombo().removeModifyListener(modifyListener);
		comboPrescripteur2.getCombo().removeModifyListener(modifyListener);
		comboPrescripteur3.getCombo().removeModifyListener(modifyListener);
		tUFPrescr.removeModifyListener(modifyListener);
		tNomPrenomAutrePresc.removeModifyListener(modifyListener);
		if (bModifierNnbChamp != null) {
			bModifierNnbChamp.removeSelectionListener(selectionListener);
		}
		// prenatal
		if (dateDG != null && !dateDG.getControl().isDisposed()) {
			dateDG.getControl().removeModifyListener(modifyListener);
			comboPonctionneur.getCombo().removeModifyListener(modifyListener);
			dateNaissanceMere.getControl().removeModifyListener(modifyListener);
			tAgeMat.getControl().removeModifyListener(modifyListener);
			tAlphaSecond.getControl().removeModifyListener(modifyListener);
			tBetaPrem.getControl().removeModifyListener(modifyListener);
			tBetaSecond.getControl().removeModifyListener(modifyListener);
			tMqSerique.getControl().removeModifyListener(modifyListener);
			tLCCPrem.getControl().removeModifyListener(modifyListener);
			tCombine.getControl().removeModifyListener(modifyListener);
			tNuquePrem.getControl().removeModifyListener(modifyListener);
			tPAPPAPrem.getControl().removeModifyListener(modifyListener);
			tSequentielIntegre.getControl().removeModifyListener(modifyListener);
			tSigneAppel.removeModifyListener(modifyListener);
			tTerme.getControl().removeModifyListener(modifyListener);
			btnRadioSexefF.removeSelectionListener(selectionListener);
			btnRadioSexefM.removeSelectionListener(selectionListener);
			btnRadioSexefNA.removeSelectionListener(selectionListener);
			btnRadioSexefI.removeSelectionListener(selectionListener);
		}

		// LA
		removeModifyListenerLA();

		// VC
		if (btnCheckGarderCultureVC != null && !btnCheckGarderCultureVC.isDisposed()) {
			btnCheckGarderCultureVC.removeSelectionListener(selectionListener);

			for (Button cAspectMacroVC : comboAspectMacroVC) {
				cAspectMacroVC.removeSelectionListener(selectionListener);
			}
			for (Button cAspectMicroVC : comboAspectMicroVC) {
				cAspectMicroVC.removeSelectionListener(selectionListener);
			}

			comboVolVC.removeModifyListener(modifyListener);
			tASpecifierAspectMacroVC.removeModifyListener(modifyListener);
			tASpecifierAspectMicroVC.removeModifyListener(modifyListener);
			dateMiseEnCultureVC.getControl().removeModifyListener(modifyListener);
		}

		// Fibro
		if (comboAspectFibro != null && !comboAspectFibro.isDisposed()) {
			comboAspectFibro.removeModifyListener(modifyListener);
			comboVolFibro.removeModifyListener(modifyListener);
			dateMiseEnCultureF.getControl().removeModifyListener(modifyListener);
		}

		// SANG
		removeModifyListenerSang();

		removeModifyListenerADN();

		if (btnAjouterUneAnalyse != null && !btnAjouterUneAnalyse.isDisposed()) {
			btnAjouterUneAnalyse.removeSelectionListener(selectionListener);
			itemAddAnalyse.removeSelectionListener(selectionListener);
		}

	}

	private void removeModifyListenerLA() {
		for (int i = 0; i < comboAspectCulotLA.size(); i++) {
			if (comboAspectCulotLA != null && comboAspectCulotLA.size() > i && !comboAspectCulotLA.get(i).isDisposed()) {
				comboAspectCulotLA.get(i).removeModifyListener(modifyListener);
				comboAspectLA.get(i).removeModifyListener(modifyListener);
				comboVolCulotLA.get(i).removeModifyListener(modifyListener);
				comboVolLA.get(i).removeModifyListener(modifyListener);
				tASpecifierAspectCulotLA.get(i).removeModifyListener(modifyListener);
				tASpecifierAspectLA.get(i).removeModifyListener(modifyListener);
				tASpecifierVolLA.get(i).removeModifyListener(modifyListener);

				btnCheckEnvoye.get(i).removeSelectionListener(selectionListener);
				tCommentaireEnvoi.get(i).removeModifyListener(modifyListener);
				if (bSupLA.size() > i) {
					bSupLA.get(i).removeSelectionListener(selectionListener);
				}
			}
		}
		if (btnCheckGarderCultureLA != null) {
			btnCheckGarderCultureLA.removeSelectionListener(selectionListener);
		}
		if (dateMiseEnCultureLA != null) {
			dateMiseEnCultureLA.getControl().removeModifyListener(modifyListener);
		}

	}

	private void removeModifyListenerSang() {
		for (int i = 0; i < comboAspectSang.size(); i++) {
			if (comboAspectSang != null && comboAspectSang.size() > i && !comboAspectSang.get(i).isDisposed()) {
				comboAspectSang.get(i).removeModifyListener(modifyListener);
				comboTube.get(i).removeModifyListener(modifyListener);
				comboVolSang.get(i).removeModifyListener(modifyListener);
				tRangementSang.get(i).removeModifyListener(modifyListener);
				tASpecifierTube.get(i).removeModifyListener(modifyListener);
				dateMiseEnCultureS.get(i).getControl().removeModifyListener(modifyListener);
				tCommentaireEnvoi.get(i).removeModifyListener(modifyListener);
				btnCheckEnvoye.get(i).removeSelectionListener(selectionListener);
				dateMiseEnCultureS.get(i).getControl().removeModifyListener(modifyListener);
				if (bSupS.size() > i) {
					bSupS.get(i).removeSelectionListener(selectionListener);
				}
			}
		}
	}

	private void addDirtyListener() {

		// prelévement
		tNSejour.getControl().addModifyListener(modifyListener);
		tNumeroPrelevement.addModifyListener(modifyListener);
		tInfoIndication.addModifyListener(modifyListener);
		btnRadioBanques.addSelectionListener(selectionListener);
		btnRadioCellules.addSelectionListener(selectionListener);
		btnRadioPostnatal.addSelectionListener(selectionListener);
		btnRadioPrenatal.addSelectionListener(selectionListener);
		btnRadioPucesPost.addSelectionListener(selectionListener);
		btnRadioFoeto.addSelectionListener(selectionListener);
		btnRadioPucesFoeto.addSelectionListener(selectionListener);
		btnRadioPucesPre.addSelectionListener(selectionListener);
		btnCheckRecherche.addSelectionListener(selectionListener);
		btnCheckDpi.addSelectionListener(selectionListener);
		comboDerive.getCombo().addModifyListener(modifyListener);
		comboTypeEchantillon.getCombo().addModifyListener(modifyListener);
		comboTypeIndication.getCombo().addModifyListener(modifyListener);
		datePrelev.getControl().addModifyListener(modifyListener);
		dateReception.getControl().addModifyListener(modifyListener);
		comboTypeEchantillon.addSelectionChangedListener(comboTypeEchantillonSelectionChangedListener);

		comboPrescripteur.addSelectionChangedListener(selectionChangedComboPresc);
		comboPrescripteur.getCombo().addModifyListener(modifyListener);
		comboPrescripteur2.getCombo().addModifyListener(modifyListener);
		comboPrescripteur3.getCombo().addModifyListener(modifyListener);
		tUFPrescr.addModifyListener(modifyListener);
		tNomPrenomAutrePresc.addModifyListener(modifyListener);

		if (bModifierNnbChamp != null) {
			bModifierNnbChamp.addSelectionListener(selectionListener);
		}
		// prenatal
		if (dateDG != null) {
			dateDG.getControl().addModifyListener(modifyListener);
			comboPonctionneur.getCombo().addModifyListener(modifyListener);
			dateNaissanceMere.getControl().addModifyListener(modifyListener);
			tAgeMat.getControl().addModifyListener(modifyListener);
			tAlphaSecond.getControl().addModifyListener(modifyListener);
			tBetaPrem.getControl().addModifyListener(modifyListener);
			tBetaSecond.getControl().addModifyListener(modifyListener);
			tMqSerique.getControl().addModifyListener(modifyListener);
			tLCCPrem.getControl().addModifyListener(modifyListener);
			tCombine.getControl().addModifyListener(modifyListener);
			tNuquePrem.getControl().addModifyListener(modifyListener);
			tPAPPAPrem.getControl().addModifyListener(modifyListener);
			tSequentielIntegre.getControl().addModifyListener(modifyListener);
			tSigneAppel.addModifyListener(modifyListener);
			tTerme.getControl().addModifyListener(modifyListener);
			btnRadioSexefF.addSelectionListener(selectionListener);
			btnRadioSexefM.addSelectionListener(selectionListener);
			btnRadioSexefNA.addSelectionListener(selectionListener);
			btnRadioSexefI.addSelectionListener(selectionListener);

		}

		// LA
		addModifyListenerLA();

		// VC
		if (btnCheckGarderCultureVC != null) {
			btnCheckGarderCultureVC.addSelectionListener(selectionListener);
			for (Button cAspectMacroVC : comboAspectMacroVC) {
				cAspectMacroVC.addSelectionListener(selectionListener);
			}
			for (Button cAspectMicroVC : comboAspectMicroVC) {
				cAspectMicroVC.addSelectionListener(selectionListener);
			}
			comboVolVC.addModifyListener(modifyListener);
			tASpecifierAspectMacroVC.addModifyListener(modifyListener);
			tASpecifierAspectMicroVC.addModifyListener(modifyListener);
			dateMiseEnCultureVC.getControl().addModifyListener(modifyListener);
		}

		// Fibro
		if (comboAspectFibro != null) {
			comboAspectFibro.addModifyListener(modifyListener);
			comboVolFibro.addModifyListener(modifyListener);
			dateMiseEnCultureF.getControl().addModifyListener(modifyListener);
		}

		// SANG
		addModifyListenerS();

		// ADN

		addModifyListenerADN();

		if (btnAjouterUneAnalyse != null) {
			btnAjouterUneAnalyse.addSelectionListener(selectionListener);
			itemAddAnalyse.addSelectionListener(selectionListener);
		}
	}

	private void addModifyListenerS() {
		for (int i = 0; i < comboAspectSang.size(); i++) {
			if (comboAspectSang != null && comboAspectSang.size() > i && !comboAspectSang.get(i).isDisposed()) {
				comboAspectSang.get(i).addModifyListener(modifyListener);
				comboTube.get(i).addModifyListener(modifyListener);
				comboVolSang.get(i).addModifyListener(modifyListener);
				tRangementSang.get(i).addModifyListener(modifyListener);
				tASpecifierTube.get(i).addModifyListener(modifyListener);
				tCommentaireEnvoi.get(i).addModifyListener(modifyListener);
				btnCheckEnvoye.get(i).addSelectionListener(selectionListener);
				dateMiseEnCultureS.get(i).getControl().addModifyListener(modifyListener);
				if (bSupS.size() > i) {
					bSupS.get(i).addSelectionListener(selectionListener);
				}
			}
		}
	}

	private void addModifyListenerADN() {
		if (t260_230 != null) {
			t260_230.getControl().addModifyListener(modifyListener);
			t260_280.getControl().addModifyListener(modifyListener);
			tAE.getControl().addModifyListener(modifyListener);
			tConcentrationADN.getControl().addModifyListener(modifyListener);
			tRangementADN.addModifyListener(modifyListener);
			tVolADN.getControl().addModifyListener(modifyListener);
			dateExtraction.getControl().addModifyListener(modifyListener);

			t260_230purif.getControl().addModifyListener(modifyListener);
			t260_280purif.getControl().addModifyListener(modifyListener);
			tAEpurif.getControl().addModifyListener(modifyListener);
			tConcentrationADNpurif.getControl().addModifyListener(modifyListener);
			tRangementADNpurif.addModifyListener(modifyListener);
			tVolADNpurif.getControl().addModifyListener(modifyListener);
			datePurification.getControl().addModifyListener(modifyListener);

			btnCheckExtraction.addSelectionListener(selectionListener);
			btnCheckPurification.addSelectionListener(selectionListener);

		}
		for (int i = 0; i < comboDemandeur.size(); i++) {
			if (tVolEnvoye != null && tVolEnvoye.get(i) != null && !tVolEnvoye.get(i).getControl().isDisposed()) {

				tVolEnvoye.get(i).getControl().addModifyListener(modifyListener);
				dateEnvoi.get(i).getControl().addModifyListener(modifyListener);
				dateDemande.get(i).getControl().addModifyListener(modifyListener);
				comboDemandeur.get(i).getCombo().addModifyListener(modifyListener);

			}
		}
	}

	private void removeModifyListenerADN() {
		if (t260_230 != null && !t260_230.getControl().isDisposed()) {
			t260_230.getControl().removeModifyListener(modifyListener);
			t260_280.getControl().removeModifyListener(modifyListener);
			tAE.getControl().removeModifyListener(modifyListener);
			tConcentrationADN.getControl().removeModifyListener(modifyListener);
			tRangementADN.removeModifyListener(modifyListener);
			tVolADN.getControl().removeModifyListener(modifyListener);
			dateExtraction.getControl().removeModifyListener(modifyListener);

			t260_230purif.getControl().removeModifyListener(modifyListener);
			t260_280purif.getControl().removeModifyListener(modifyListener);
			tAEpurif.getControl().removeModifyListener(modifyListener);
			tConcentrationADNpurif.getControl().removeModifyListener(modifyListener);
			tRangementADNpurif.removeModifyListener(modifyListener);
			tVolADNpurif.getControl().removeModifyListener(modifyListener);
			datePurification.getControl().removeModifyListener(modifyListener);

			btnCheckExtraction.removeSelectionListener(selectionListener);
			btnCheckPurification.removeSelectionListener(selectionListener);
		}
		for (int i = 0; i < comboDemandeur.size(); i++) {
			if (tVolEnvoye != null && tVolEnvoye.get(i) != null && !tVolEnvoye.get(i).getControl().isDisposed()) {

				tVolEnvoye.get(i).getControl().removeModifyListener(modifyListener);
				dateEnvoi.get(i).getControl().removeModifyListener(modifyListener);
				dateDemande.get(i).getControl().removeModifyListener(modifyListener);
				comboDemandeur.get(i).getCombo().removeModifyListener(modifyListener);

			}
		}
	}

	private void addModifyListenerLA() {
		for (int i = 0; i < comboAspectCulotLA.size(); i++) {
			if (comboAspectCulotLA != null && comboAspectCulotLA.size() > i && !comboAspectCulotLA.get(i).isDisposed()) {
				comboAspectCulotLA.get(i).addModifyListener(modifyListener);
				comboAspectLA.get(i).addModifyListener(modifyListener);
				comboVolCulotLA.get(i).addModifyListener(modifyListener);
				comboVolLA.get(i).addModifyListener(modifyListener);
				tASpecifierAspectCulotLA.get(i).addModifyListener(modifyListener);
				tASpecifierAspectLA.get(i).addModifyListener(modifyListener);
				tASpecifierVolLA.get(i).addModifyListener(modifyListener);

				tCommentaireEnvoi.get(i).addModifyListener(modifyListener);
				btnCheckEnvoye.get(i).addSelectionListener(selectionListener);
				if (bSupLA.size() > i) {
					bSupLA.get(i).addSelectionListener(selectionListener);
				}
			}
		}
		if (dateMiseEnCultureLA != null) {
			dateMiseEnCultureLA.getControl().addModifyListener(modifyListener);
		}
		if (btnCheckGarderCultureLA != null) {
			btnCheckGarderCultureLA.addSelectionListener(selectionListener);
		}
	}

	public void changeFormulaireParSecteur(String texte) {
		ArrayList<TypePrelevement> listTypePrelevements = ReferentielServiceImpl.getInstance().getTypePrelevementBySecteur(texte);
		// fill the list with ComboValue objects
		comboTypeEchantillon.setInput(listTypePrelevements);
		groupEchantillon.pack();
		if (texte.equals(btnRadioPrenatal.getText()) || texte.equals(btnRadioPucesPre.getText())) {
			createPrenatal();
			groupPrenatal.setVisible(true);
			((GridData) groupPrenatal.getLayoutData()).exclude = false;
		} else {
			if (groupPrenatal != null) {
				groupPrenatal.setVisible(false);
				((GridData) groupPrenatal.getLayoutData()).exclude = true;
			}

		}
		if (texte.equals(ApplicationContexte.SECTEUR_PUCE_FOETO) || texte.equals(ApplicationContexte.SECTEUR_PUCE_POSTNATAL) || texte.equals(ApplicationContexte.SECTEUR_PUCE_PRENATAL)) {
			createGroupeADN();
			gpAD.setVisible(true);
			((GridData) gpAD.getLayoutData()).exclude = false;
		} else {
			if (gpAD != null) {
				gpAD.setVisible(false);
				((GridData) gpAD.getLayoutData()).exclude = true;
			}
		}
		ArrayList<Biomedecine> listTypeIndication = ReferentielServiceImpl.getInstance().getTypeIndication(texte);
		comboTypeIndication.setInput(listTypeIndication);
		composite_1.pack();
		sc1.redraw();

	}

	public boolean verifierChamp() {
		if (!btnRadioPrenatal.getSelection() && !btnRadioPostnatal.getSelection() && !btnRadioPucesPre.getSelection() && !btnRadioPucesPost.getSelection() && !btnRadioBanques.getSelection() && !btnRadioCellules.getSelection() && !btnRadioPucesFoeto.getSelection() && !btnRadioFoeto.getSelection()
				&& DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "btnRadioSecteur")) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " : Champs obligatoire manquant : Secteur manquant");
			return false;
		}
		ISelection selectionEchantillon = comboTypeEchantillon.getSelection();
		if (selectionEchantillon.isEmpty() && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboTypeEchantillon")) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " : Champs obligatoire manquant : Type d'échantillon manquant");
			return false;
		}
		ISelection selectionIndication = comboTypeIndication.getSelection();
		if (selectionIndication.isEmpty() && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboTypeIndication")) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " : Champs obligatoire manquant : Indication, celui-ci à été mis à non renseigné");
			prelevement.setIndication(ReferentielServiceImpl.getInstance().getTypeIndicationById(36));
			comboTypeIndication.setSelection(new StructuredSelection(prelevement.getIndication()), true);
		}
		if (tUFPrescr.getText().isEmpty() && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tUFPrescr")) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " : Champs obligatoire manquant : UF prescripteur (9990 pour l'extérieur)");
			return false;
		}
		if (tUFPrescr.getText().length() < 3 && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "tUFPrescr")) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur de format", "Onglet " + this.getTabItem().getText() + " : Erreur de format : l'UF doit posséder 4 chiffres (9990 pour l'extérieur)");
			return false;
		}
		ISelection selectionMedecin = comboPrescripteur.getSelection();
		if (selectionMedecin.isEmpty() && tNomPrenomAutrePresc.getText().isEmpty() && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "comboPrescripteur")) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " , Champs obligatoire manquant : Prescripteur");
			return false;
		}
		// verif numeSéjour
		String numSejour = tNSejour.getControl().getText();
		if (numSejour != null && !numSejour.isEmpty()) {
			if (numSejour.length() != 10) {
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur de taille", "Onglet " + this.getTabItem().getText() + " Erreur de taille : le numéro de séjour doit être composé de 10 chiffres");
				return false;
			}
		}
		if (numSejour != null && numSejour.isEmpty()) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " : Champs obligatoire manquant : Numéro de séjour manquant");
			return false;
		}
		// verif date naissance
		Date ddP = (Date) datePrelev.getValue();
		Date ddR = (Date) dateReception.getValue();
		if (ddP == null && ddR == null) {
			MessageDialog.openError(Display.getCurrent().getActiveShell(), "Champs obligatoire manquant", "Onglet " + this.getTabItem().getText() + " : Champs obligatoire manquant : La date de réception ou de prélèvement doit être remplie");
			return false;
		}
		if (datePrelev.getValue() != null && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "datePrelev")) {
			String message = ApplicationContexte.getInstance().valideDate((Date) datePrelev.getValue());
			if (!message.isEmpty()) {
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur de format", "Onglet " + this.getTabItem().getText() + " : Erreur de format : Date de prélèvement : " + message);
				return false;
			}

		}
		if (dateReception.getValue() != null && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "dateReception")) {
			String message = ApplicationContexte.getInstance().valideDate((Date) dateReception.getValue());
			if (!message.isEmpty()) {
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur de format", "Onglet " + this.getTabItem().getText() + " : Erreur de format : Date de réception : " + message);
				return false;
			}

		}
		if (dateDG != null && dateDG.getValue() != null && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champPrenatal")) {
			String message = ApplicationContexte.getInstance().valideDate((Date) dateDG.getValue());
			if (!message.isEmpty()) {
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur de format", "Onglet " + this.getTabItem().getText() + " : Erreur de format : Date de début de grossesse : " + message);
				return false;
			}

		}

		if (dateNaissanceMere != null && dateNaissanceMere.getValue() != null && DroitServiceImpl.getInstance().peutModifierByUtilisateurAndChamp(ApplicationContexte.getInstance().getUtilisateur(), "champPrenatal")) {
			String message = ApplicationContexte.getInstance().valideDate((Date) dateNaissanceMere.getValue());
			if (!message.isEmpty()) {
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Erreur de format", "Onglet " + this.getTabItem().getText() + " : Erreur de format : Date de naissance de la mère : " + message);
				return false;
			}

		}
		return true;
	}
}
